Karl Marx famously quipped that religion was the opium of the masses. I submit that this aphorism should be taken more seriously, that considering religion as a drug can be a constructive framework for understanding religion both for believers and, more to the point, non-believers. Non-believers tend to focus on religious claims rather than the effects of believing (or even going through the motions of believing) in those claims, and thus tend to miss the forest for the trees. The result is endless cycles of useless thrashing, wasted emotional energy, and a lot of unnecessary pain.
To begin, let me be precise about exactly what I mean by "religion is a drug." I mean for this view to be taken literally, not metaphorically. Now, obviously I do not mean that religion is a chemical. Religion is a placebo, but that emphatically does not mean that it's "imaginary" or "all in your head." The placebo effect is a real, scientifically observable physical phenomenon with actual physiological effects. The placebo effect can, for example, measurably reduce physical pain, sometimes in cases where all other treatments are ineffective.
It is important to emphasize that the placebo effect is not mystical mumbo-jumbo. It is as well established a scientific fact as you cold hope to find. That double-blind studies are the gold standard of scientific proof in medicine is an explicit acknowledgement of the power of the placebo effect. To demonstrate the effectiveness of a pharmaceutical you have to explicitly and laboriously exclude the possibility that any observed benefit was due to the placebo effect. Doing a properly controlled double-blind study is difficult precisely because the mechanism by which the placebo effect operates is belief, which is very difficult to control with precision.
But religion is not just a placebo; it is in some sense the ultimate placebo, honed and refined over thousands of years to be vastly more potent and powerful than a mere sugar pill. Whereas the curative powers of a sugar pill can be undermined simply by revealing that it is a sugar pill, religions have built-in defenses against such anti-revelations, sometimes layer upon layer of defenses. Whereas sugar pills derive their power from the (presumed) authority of a medical doctor, religions derive theirs, if not from God Himself, at least from His authority. This is one of the most important things that non-believers miss about religion: because placebos derive their power from belief, it doesn't matter whether the thing being believed in is real or not. As long as the belief is genuine, it works. So it doesn't matter if the power of religion actually derives from God or merely from the idea of God; for the purpose of inducing a placebo effect, they are the same thing.
Placebos are particularly effective at producing relief from emotional pain, which is no less real and can be no less intense that actual physical pain. To this I can bear personal witness. I have (like many technically inclined people, I think) suffered from periodic bouts of severe, debilitating depression, even leading on one occasion back in grad school to a half-hearted suicide attempt. Even as a life-long confirmed non-believer, I find the odd prayer occasionally to be palliative. (I often tell people with tongue only half-way in cheek that I'm an unusual atheist: I talk to God. Moreover, He talks back. I tell Him that I don't believe in Him, and He tells me that's OK, that He's here for me when I need Him, but that He can get along without me.)
Within this framework a lot of seemingly intractable problems simply evaporate. Theodicy, for example, becomes a complete non-issue. The existence of evil is only a philosophical problem if one assumes that religious beliefs exist to describe objective reality. On the religion-as-a-drug view, that is not the reason religious beliefs exist at all, they exist to produce a placebo effect. The idea of an all-powerful all-knowing all-just all-loving God prevails not because it's (objectively) true, but because it's therapeutically effective. Moreover, it's a lot more effective if you believe it's actually, objectively true. So people believe it's actually objectively true. And they defend those beliefs against all reason because to do otherwise is painful, in many cases too painful to bear. This is not a sign of intellectual weakness or duplicity. It is simply an aspect of being human. We are both rational and emotional creatures, yin and yang. Militant atheism fails because it ignores this inconvenient truth. (It is no surprise to me that Christopher Hitchens is a chain-smoking alcoholic. Very few people can summon the courage to face the awful realities of life without some form of chemical intervention.)
The religion-as-drug framework helps make sense of many other normally vexing (to atheists) aspects of religious belief. Like any drug, it can be both beneficial (if it alleviates pain) and harmful (if it is abused). It comes in different forms with varying potencies and side-effects. It can be bought and sold. Because it's legal (mostly), there is a thriving economy in religious ideas catering to all segments of a huge and diverse market. It can be addictive, which is good if you make your living as a dealer, not so good if you become a junkie.
And, of course, like other psychoactive drugs, religion can make you crazy, even violent if not taken judiciously.
Finally, the religion-as-drug framework offers some useful insight into the likely outcomes of efforts to rid the world of religion, which are as likely to succeed as efforts to rid the world of other drugs have been. In particular, religion is very unlikely to yield to either reason, ridicule, or prohibition. It is important to understand that people don't adopt religious beliefs because they are stupid, they do it because self-deception can, via the placebo effect, actually improve quality of life. Until this is understood and accepted, the secular and religious will continue to be at loggerheads.