In another scenario, consider that you're in the midst of outrunning a bear, and you sprain your ankle. Ordinarily, the pain would be unbearable and potentially crippling. Yet, in this life-or-death scenario, you barely feel a twinge and keep running. This phenomenon is thanks to an intricate and clever system in your body known as modulation—the brain's method of tweaking the intensity of pain signals depending on the situation.
Here’s how this incredible feat of biological engineering works: As the pain signal from your sprained ankle travels up your spine to your brain, it enters a high-level processing center known as the periaqueductal gray matter located in the midbrain. This area acts as a sort of command center, sending out its own action potentials which journey to the pons and medulla, specifically targeting regions known as the locus coeruleus and nucleus raphe magnus.
From these brain regions, a new action potential shoots down through the dorsolateral tract of the spinal cord and reaches an interneuron positioned near where the primary and secondary afferent neurons meet. Here, the magic of modulation happens. This interneuron sends out inhibitory signals which dampen the pain signals en route to the brain. It achieves this by reducing the release of pain-promoting chemicals like glutamate and substance P from the primary neuron and decreasing the excitability of the secondary neuron.
This entire process is underpinned by various neurotransmitters, with endogenous opioids playing a big role. Endogenous opioids are natural painkillers such as enkephalins that the body produces. These biochemicals are pivotal in altering how pain is perceived, effectively turning down the volume on the pain signals.

This sophisticated system is a real-life application of the gate theory of pain, first proposed by Melzack and Wall in 1965. The theory illustrates why certain therapies like transcutaneous electrical nerve stimulation (TENS) or simply rubbing a sore spot can be effective. These actions flood the spinal synapses with non-painful signals from large, myelinated A-beta fibers, creating a neural "traffic jam." This congestion blocks the pain signals triggered by nociceptors at the injury site, allowing for relief and, in some extreme cases like our hypothetical lion chase, enabling you to keep running despite the injury. This clever biological hack highlights just how dynamic and responsive our nervous system is in managing pain based on context and necessity.