Most people have had the experience of banging your shin against the dresser or bedpost in the middle of the night. The pain hits immediately, and before we even have time to have a thought our hands reach down and begin rubbing that leg. This massaging is what is called a counterirritant. The reason we do is that our brains instinctively know it works as a quick pain reduction technique.
In brief, studies have found that our brains and bodies are self-protecting, and while initial news of an injury is useful information, pain beyond that is often unnecessary. What can happen is that, when provided with a counterirritant, the brain (unconsciously) can choose to close the “gateway” to the pain sensation and only allow in the sensation produced by the counterirritant (rubbing your shin). So, while you still often feel some degree of pain, it is dulled to more of a background noise, with the counterirritant taking the main focus. And while this is partly an element of simple distraction of your attention, there is also a biochemical action at play. (This is one of the reasons that treatments such as menthol, capsaicin, “icy hot,” massage, TENS, and acupuncture are typical pain treatments).
So if you picture an actual gate, you can consider that the brain only lets in the visitors it likes, or finds helpful, and the rest can be turned away (so to speak). The reason this is of interest to a psychologist is that the research suggests that emotional experiences can also serve as counterirritants. So, consider the same injury (banging your shin) but picture this happening in the context of you walking down the street holding hands with your spouse, or while playing soccer with your niece. In that situation, when presumably your emotions are more primed to be strongly positive, your brain may choose to focus more attention to the pleasant sensation (emotion) rather than the unpleasant sensation (your shin).
There is evidence that negative emotions can also close the gate to pain (if the negative emotion or experience is strong enough). The catch, of course, is that now your emotions take a negative turn, and much research indicates that negative moods lead to negative interpretations of events, and thus, worse pain sensations. So with negative emotions the counterirritant effect is a bit more complex and complicated.
I recommend pleasant/positive emotions serve as your emotional counterirritant, or a good massage. Seek out pleasant experiences, even if you are in pain, because you are in pain. Rather than the pain spoiling the day, a nice day with loved ones may actually lessen your pain. Try tasty foods, good theater, joyful music, quiet sunsets – eventually you will find a successful counterirritant, and along the way the search will be enjoyable.
P.S. As a native New Orleanian, the current Mardi Gras season and recent Saints Superbowl win are serving as my pleasant counterirritant!