Scientific American has an article on the relationship of cannabioids, endocannabinoids, and long term pain memories and lots of other stuff about this important class of chemicals in the functioning of the brain (N.B. marijuana contains one type of canniboid). Apparently, your body's own canniboids are also involved in learning to extinguish pain and bad feelings from past experiences.
M. Simon has more, including additional studies by the Max Planck Institute. He has written opinion pieces here before arguing that a lot of drug use is just self-medication for emotional pain, and this appears to be a piece of evidence in support of his thesis.
If this research bears fruit, it has other implications as well. Medical canniboid compunds may be the key to creating new treatments for anxiety, pain, nausea, obesity, brain injury and many other medical problems.
