Here I have summarized a free full text PubMed article that goes into detail about how cannabinoids function to reduce pain and other symptoms. The “Concluding Remarks” section best summarizes the gist of the article, so I’ve put it first:
Cannabinoids have antinociceptive mechanisms different from that of other drugs currently in use, which thus opens a new line of promising treatment to mitigate pain that fails to respond to the pharmacologic treatments available, especially for neuropathic and inflammatory pains.
One of the drawbacks of investigating cannabinoids is their typification as substances of abuse. However, compounds blunting severe pain allow patients to perform daily activities more easily, so the potential benefits should be weighed against possible adverse effects.
Clinical trials seem to indicate that either extracts of the Cannabis sativa plant containing known amounts of the active compounds (mainly THC and CBD) or diverse synthetic derivatives of THC are promising treatments for painful conditions that do not respond to available treatments, such as neuropathic, inflammatory and oncologic pain.
CB2 receptor selective agonists with no central effects are other promising pain treatment under investigation.
Here is the summary of the rest of the article:
Endogenous Cannabinoid Receptors
The biological effects of cannabinoid compounds are mediated by their binding to and further activation of cannabinoid receptors. Four subtypes of these receptors have been identified. Two have been cloned, type 1 (CB1) and type 2 (CB2)
CB1 receptors are abundant and widely dispersed throughout the brain.
CB1 receptors are synthesised in neurons of the rat dorsal root ganglia (that express neuropeptide markers found in nociceptive primary afferents) , and these receptors are transported both centrally, reaching superficial dorsal horn terminals  and peripherally towards peripheral nerve terminals of sensory nerves . Interestingly, these sensory nerves are engaged in the ascent of nociceptive stimuli to the spinal cord
The endocannabinoids, or endogenous cannabinoids, are a family of bioactive lipids that activate cannabinoid receptors to exercise their effects, modulating neural transmission. They are present in only small amounts in brain and other tissues and participate in the regulation of various cerebral functions, including pain perception, mood, appetite, and memory.
Activation of cannabinoid receptors inhibits GABAergic synaptic transmission in a number of central nervous system regions, including areas participating in nociceptive signalling like the amygdala , periaqueductal grey matter , rostral ventromedial medulla (RVM) , and superficial dorsal horn .
Activation of Cannabinoid Receptors
Cannabinoid receptor agonists effects in the central nervous system (CNS) include disruption of psychomotor behaviour, short-term memory impairment, intoxication, stimulation of appetite, antiemetic effects, and antinociceptive actions .
Administration of natural or synthetic cannabinoid receptor agonists has shown therapeutic value for a number of important medical conditions, including pain (particularly against pain of neuropathic origin), anxiety, glaucoma, nausea, emesis, muscle spasms, and wasting diseases.
Insofar as pain is concerned, it is well known that cannabinoid receptor agonists have antinociceptive and anti-hyperalgesic effects at the peripheral and central (spinal and supraspinal) levels, as has been demonstrated in acute and chronic pain models [69, 116]. Cannabinoid receptors and endocannabinoids are present in pain circuits from the peripheral sensory nerve endings up to the brain (Fig. (Fig.1).1). Cannabinoid receptor agonists modulate nociceptive thresholds by regulating neuronal activity , but they also relieve pain by acting on non-nervous tissues
CB1 receptor is involved in the attenuation of synaptic transmission, and a proportion of the peripheral analgesic effect of endocannabinoids can be attributed to a neuronal mechanism acting through CB1 receptors expressed by primary afferent neurons
However, recent findings suggest that CB1 receptors are also present in mast cells and may participate in some anti-inflammatory effects.
activation of peripheral CB2 receptors generates an antinociceptive response in situations of inflammatory hyperalgesia and neuropathic pain
Possible mechanisms of this CB2-mediated effect include the attenuation of NGF-induced mast cell degranulation and of neutrophil accumulation, both of which are processes known to contribute to the generation of inflammatory hyperalgesia
CB2 receptors have novel pain control actions. A CB2-mediated effect exists, consisting in the indirect stimulation of opioid receptors located in primary afferent pathways
Thus, cannabinoid compounds can modulate hyperalgesia of various origins and they are effective even in inflammatory and neuropathic pain
Cannabinoids and Opioids Analgesic Synergism
Cannabinoid and opioid receptors both exist at various levels in the pain circuits and these two systems may operate synergistically. THC and morphine have been shown to act synergistically, mutually potentiating their antinociceptive actions.
although cannabinoids and opioids both produce analgesia within the dorsal horn, their pharmacologic mechanisms of action differ.
cannabinoid receptor agonists induce the synthesis and/or release of endogenous opioid peptides
although the antinociception of morphine is mediated predominately by μ-opioid receptors, it may be enhanced by THC through the activation of kappa and delta opioid receptors.
new CB2 locations and mechanisms of action, which are important to pain modulation, have been recently identified
These CB2 receptors, when activated, stimulate release of the endogenous opioid β-endorphin, which then acts at μ-opioid receptors on local primary afferent neurons to inhibit nociception.
Interactions Between Cannabinoids and Prostaglandin Inhibitors and COX-2
An interaction between cannabinoids and inhibitors of prostaglandin biosynthesis (like NSAIDs) has been reported, and it appears to be due to the similarity in chemical structure of endogenous cannabinoid ligands and prostaglandins (arachidonic acid derivatives
The enhancement of CB1 receptors activity by some NSAIDs (indomethacin, fluribuprofen) has been confirmed
COX-2 exerts a negative influence on endocannabinoids because it catabolises them
This also suggests that COX-2 inhibitors treatment may produce an indirect enhancement of cannabinoid receptors activity, by increasing endocannabinoid levels.
THERAPEUTIC USES OF CANNABINOIDS IN PAIN EPISODES
Studies in experimental models of acute and chronic pain have demonstrated the efficacy of cannabinoid receptor agonists, even in neuropathic or inflammatory pain
The results to date suggest that cannabinoid receptor agonists are analgesic substances per se whose potency is similar to that of opioids like codeine
Unfortunately, few clinical trials have been made and they have been carried out with major methodologic limitations.
cannabinoid receptor agonists have shown to be up to 10 times more potent than morphine in animal models of acute and neuropathic pain
THC is the substance with the greatest psychoactive potency of the natural cannabinoids, and exhibits the greatest analgesic activity
THC administered epidurally (intrathecal, intraventricular) produces antinociception similar to that obtained with opioid compounds
Clinical trials have shown that nonselective cannabinoid receptor agonists are relatively safe and therapeutically efficacious, but they also induce psychotropic side effects
The THC analogues most often used for preclinical or therapeutic purposes in humans are dronabinol, nabilone, levonantradol, CT-3 (or ajulemic acid), and HU211
Cannabidiol (CBD) is another major constituent of the Cannabis sativa plant, having the same therapeutic effects than THC (analgesic, anti-inflammatory, and others), but with a different pharmacologic profile
some of these cannabidiol derivatives did not have central nervous system effects, but maintained their antinociceptive and anti-inflammatory properties.
Medications have also been developed from extracts of the Cannabis sativa plant containing known amounts of THC and CBD [6, 111, 163, 164]. These medications are being used in clinical trials, and a form dispensed as sublingual spray has just been approved to be marketed in Canada
the role of CB2 receptors is fundamental in other cannabimimetic actions, such as immunomodulatory and antiproliferative effects. On the other hand, as mentioned earlier, new CB2 receptor properties are being discovered, as it has been confirmed that they indirectly stimulate opioid receptors located in primary afferent pathways .
Smoking cannabis remains the most efficient means of drug delivery since absorption is much more rapid
the effects of natural cannabinoids (plant extracts) seems to be better than those of synthetic cannabinoids.
Short-term effects, such as unsteadiness, dizziness, difficulty concentrating, drowsiness, dryness of the mouth, and/or headache, are related to depression of the central nervous system.
Chronic cannabis use does not produce serious cognitive disorders, as occurs with other substances like alcohol, but it can aggravate pre-existing mental disease.
one of the best documented therapeutic uses of cannabinoid derivatives, and the one most widely approved today, is as an antiemetic drug … have proven to be extremely effective for relieving nausea and emesis due to gastrointestinal distress caused by acquired immunodeficiency syndrome (AIDS) medications or cancer chemotherapy.
Postoperative pain interfere with functioning and healing, and it can grow to intolerable levels. However, there is no drug for this condition which produces adequate analgesia with no side effects. Some clinical trials, using cannabinoid derivatives in postoperative pain, have been undertaken or are in progress (Table (Table22).
Multiple sclerosis (MS) is a life-long chronic disease in which nerve cells are attacked by the immune system, originating painful muscle spasms and many other problems, including neuropathic pain
Smoking cannabis not only has helped to stop spasms, but has halted the progression of multiple sclerosis.
Medications prepared from whole plant cannabis extract, containing known amounts of THC and CBD as the principal components have been prepared to be administered by oral spray to relieve MS symptoms, as well as for the treatment of other disorders with severe neuropathic pain. This product has undergone phase III placebo-controlled trials
It is important to emphasise that cannabinoid receptor agonists are more effective than opioids in the management of neuropathic pain
This means that cannabinoid receptor agonists have more capacity for suppressing pathophysiologic mechanisms like the wind-up phenomenon linked to this type of pain
Cannabinoids are among the compounds under development for the treatment of these patients, and they seem to have analgesic activity
data that support their therapeutic potential thanks to their anti-inflammatory and sedative properties
Historically, cannabis was prescribed for its management in the early 20th century. At present, the antimigraine properties of cannabis have been recognised  and there are studies that affirm that the pain relief it produces is comparable, or better than, that achieved with ergotamine and aspirin.