[citation needed] The NRM receives afferent stimuli from the enkephalinergic neurons of the periaqueductal gray; the serotonergic neurons of the NRM then bilaterally project efferents to the enkephalinergic and dynorphin-containing interneurons of the substantia gelatinosa of the posterior grey column of the spinal cord.
This neural path thus mediates pain perception through pre-synaptic inhibition of first-order afferent (sensory) neurons.
Mounting evidence suggests that the nucleus raphe magnus plays an important role in homeostatic regulation.
It sends projections to the enkephalin-releasing interneurons of the posterior grey column to directly inhibit pain.
All of this seems to indicate that the nucleus raphe magnus is part of the endogenous opiate system, and acts to inhibit pain in the spinal cord.