Gate control theory of pain
The gate control theory of pain, put forward by Ronald Melzack and Patrick Wall in 1962 , and again in 1965 , is the idea that physical pain is not a direct result of activation of pain receptor neurons, but rather its perception is modulated by interaction between different neurons.

# Development
Experiments were performed on dogs who were raised confined in cages. When released, the dogs were excited, constantly ran around, and required several attempts to learn to avoid pain.  When pain such as a pinch or contact with a burning match was encountered, the animals could not take action to avoid the stimulus immediately. This finding seemed to demonstrate that pain is understood and avoided only by experience--aversion to it is not inbuilt or automatic, and the organism has no way to know what will cause repeated pain without a repeated experience....

# Physiology
Afferent pain-receptive nerves, those that bring signals to the brain, comprise at least two kinds of fibers - a fast, relatively thick, myelinated "A" fiber that carries messages quickly with intense pain, and a small, unmyelinated, slow "C" fiber that carries the longer-term throbbing and chronic pain.  Large-diameter A fibers are nonnociceptive (do not transmit pain stimuli) and inhibit the effects of firing by A and C fibers.
The peripheral nervous system has centers at which pain stimuli can be regulated. Some areas in the dorsal horn of the spinal cord that are involved in receiving pain stimuli from A and C fibers, called laminae, also receive input from A fibers (Kandel et al., 2000).  The nonnociceptive fibers indirectly inhibit the effects of the pain fibers, 'closing a gate' to the transmission of their stimuli (Kandel et al., 2000).  In other parts of the laminae, pain fibers also inhibit the effects of nonnociceptive fibers, 'opening the gate'.
An inhibitory connection may exist with A and C fibers, which may form a synapse on the same projection neuron.  The same neurons may also form synapses with an inhibitory interneuron that also synapses on the projection neuron, reducing the chance that the latter will fire and transmit pain stimuli to the brain.  The C fiber's synapse would inhibit the inhibitory interneuron, indirectly increasing the projection neuron's chance of firing.  The A fiber, on the otherhand, forms an excitatory connection with the inhibitory interneuron, thus decreasing the projection neuron's chance of firing (like the C fiber, the A fiber also has an excitatory connection on the projection neuron itself).  Thus, depending on the relative rates of firing of C and A fibers, the firing of the nonnociceptive fiber may inhibit the firing of the projection neuron and the transmission of pain stimuli (Kandel et al., 2000).
Gate control theory thus explains how stimulus that activates only nonnociceptive nerves can inhibit pain. The pain seems to be lessened when the area is rubbed because activation of nonnociceptive fibers inhibits the firing of nociceptive ones in the laminae (Kandel et al., 2000).  In transcutaneous electrical stimulation (TENS), nonnociceptive fibers are selectively stimulated with electrodes in order to produce this effect and thereby lessen pain.
One area of the brain involved in reduction of pain sensation is the periaqueductal gray matter that surrounds the third ventricle and the cerebral aqueduct of the ventricular system. Stimulation of this area produces analgesia (but not total numbing) by activating descending pathways that directly and indirectly inhibit nociceptors in the laminae of the spinal cord (Kandel et al., 2000).  It also activates opioid receptor-containing parts of the spinal cord.
Afferent pathways interfere with each other constructively, so that the brain can control the degree of pain that is perceived, based on which pain stimuli are to be ignored to pursue potential gains.  The brain determines which stimuli are profitable to ignore over time.  Thus, the brain controls the perception of pain quite directly, and can be "trained" to turn off forms of pain that are not "useful".  This understanding led Melzack to point out that pain is in the brain.

# Advantages of the theory
The brain in prior theories of neurochemistry had simply not been taken into account - pain was thought to be simply a direct response to a stimulus - the so-called pain-pleasure theory, a one-way "alarm system" like that proposed by Rene Descartes.  This did not, for instance, explain why a carpenter can hit his thumb and not feel much pain, whereas a novice is doubled over in agony, nor did it explain phantom limb pain, when the signal is in fact impossible to receive, since the wiring for it is gone.

# Consequences
In his paper The Tragedy of Needless Pain, Melzack further asserts that pain is a fundamental human experience, and requires an integrative understanding of that whole experience, and every choice we have made, that has formed our own "gates".  He frames the choice to deal with pain or ignore it as moral:  if the brain can control pain, we who know that must make use of that capacity, and in turn take control of pain on a species level - only by doing so can we achieve control of the larger causes of all of the pain that humans cause each other by carelessness, hatred, and failures of empathy - which might extend beyond humans.
The impact of this theory on medical treatment for pain has been profound, and has made it a multi-disciplinary field.  A major advantage of the theory is that those being taught pain control techniques can actually be told why they work.  This seems to play a major role in achieving results - which is explained most readily by psychoneuroimmunology, in which the nerves are seen as the link between the immune system and sensory and cognitive experience.
Learning to control chronic benign pain usually takes about ten classes at the McGill University pain control centre founded by Melzack.  The classes cover areas such as diet (tryptophan-heavy foods such as turkey help control pain), drugs, psychiatry, social network choices.  Very often, chronic pain restricts sufferers' choices of friends, activities, lifestyle and profession, making them feel as though they are not in control of their lives.  In the gate control theory, this is only to be expected, as the failure to control pain can be seen as a mental illness - a brain being unable to deal with challenges that a body faces.
Pain being an entirely personal experience, it is difficult to measure, but Melzack's McGill Pain Questionnaire asks a number of directed questions to assess and categorize that experience.  By collecting words used to describe pain by the patients themselves, Melzack ended up with about 200 words.  A "burning pain" for instance, can be described as "hot" or even "searing".  "Throbbing" becomes "palpitating".  Some describe sensory aspects of pain, and others, such as "excruciating", describe emotional experiences.  More intense pain generally requires more words to describe.  A patient, in the questionnaire, picks one of 20 set of words to describe their pain, and assign it a point on a scale.  The test is used all over the world, but culture and language seem not to matter - the same words appear in almost every assessment in different languages.  For instance, group 1 lays out the scale "flickering, quivering, pulsing, throbbing," all of which imply some kind of movement or change.  Another group has the words "hot, burning, scalding, searing".  These words seem to describe actual experiences, something common to the hominid nervous system.
In The Body in Pain, Elaine Scarry writes that this process was the first to actually qualify and define types of pain - something impossible prior to the gate control theory.  An advantage of this was to make it easier to determine the difference between organic pain and non-organic pain - the latter being entirely treatable by psychological means.
Healing is directly affected by the physiological way the body behaves when the brain is or is not experiencing pain - post-traumatic stress disorder for instance can set in a long time after the physical insult, causing inordinate levels of caution, emotional withdrawal, and dealing an injury not just to the body but to the whole person.  Rates of healing are drastically affected - more serious injuries can be recovered from up to three times more quickly when pain is under control, than when it is not.
The phantom limb pain commonly experienced even by quadriplegics who have lost large portions of the spinal cord and cannot possibly be receiving any messages from it, is explained most readily by Melzack's notion of the body-self neuro-matrix, a sort of committee that can create a composite map of the body, and "represents the sense of self of the body".  The sensation of a foot that is burning, for instance, has become separated from the foot that is still attached to a useless leg dangling into space - the disconnection actually frees the neurological part of the matrix to "invent" a body.  Different parts of the brain then perceive the whole body in different ways, and these are more free to clash if real signals from a real body are not disciplining them all with a common external experience.

# Corroboration
This theory is corroborated by Reynold's comparative study on rats. By stimulating a certain area of the brain (the periaque-ductal area in the midbrain), Reynolds could induce analgesia to such an extent that the animal subjects of the experiment could undergo painless abdominal surgery whilst awake. This ties in with the Gate Control Theory, which posits that brain activity can affect the level of pain experienced.

# Further reading
Banyard, Philip (2002). Psychology in Practice: Health. Hodder and Stoughton. ISBN 0-340-84496-5..mw-parser-output cite.citation{font-style:inherit}.mw-parser-output q{quotes:"\"""\"""'""'"}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-lock-free a{background:url("")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-lock-limited a,.mw-parser-output .cs1-lock-registration a{background:url("")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-lock-subscription a{background:url("")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{display:none;font-size:100%}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}