Here is an interesting post from the blog Epiphenom. It turns out that if you prime people to think that some pill will increase anxiety, when people encounter situations that make them anxious, it will reduce their normal increase in religiosity that usually happens when one feels not in control or otherwise anxious.
[I]f they weren’t told that the pill caused anxiety, then priming with thoughts of randomness significantly increased belief in a controlling god.
However, if they were told that the pill would make them feel anxious, then the effect disappeared.
What Kay thinks is happening is that the randomness prime makes his subjects feel anxious, and they restore their sense of well being by affirming a belief in a controlling god, thereby dealing with the stress of randomness.
But the subjects who were told the pill caused anxiety had a rationale explanation for the stress they were feeling (or so they thought). Because they could explain it, they didn’t need to turn to belief in a controlling god.
I should also link to the posts he had that evidences the idea that encountering randomness or otherwise making someone feel they are not in control of events increases their belief in god; specifically a controlling god:
So can a pill take away the need for religion? Only if the person believes the pill increases anxiety…