We all know the basics of the placebo effect: Someone takes a sugar capsule that a trusted doctor has extolled as a breakthrough in pain relief, and the patient reports that the pain has disappeared. The logic would seem obvious: Either the patient never really had significant pain, or he still has pain but plays it down to please his doctor.

The seemingly obvious, however, is sometimes dead wrong. Researchers know that when someone expects a therapeutic benefit, the anticipation itself can have a real physiological effect on how much pain he feels, as well as on his emotions and cognitive performance.

But how can mere expectations change the brain’s response to pain? Over the past decade, research in many labs has revealed the central role played in this process by opioids and cannabinoids—chemicals routinely produced by our own brains. This evolutionary development goes back at least 450 million years to bony fish.

Structurally, these homegrown opioids resemble the opium derived from poppies, and homegrown cannabinoids resemble marijuana-derived cannabis. Both have docking sites on specific nerve cells, fitting as a key would into a lock. Through these receptors, the molecules change how a nerve cell behaves and hence how we feel.

Click for more from The Wall Street Journal.