http://goo.gl/7LKF9a
To explore this "pain inhibits pain" phenomenon, painful electric pulses were first administered to a subject's foot (first pain) and the resulting pain intensity was then measured. Then the subject was asked to put their hand in a bucket of ice water (novel stimulus causing pain reduction), and as they did so, a telephone ringtone sounded in headphones. After this procedure had been repeated several times, it was observed that the pain felt from the electrical stimulation was reduced simply when the ring tone sounded.
The brain had been conditioned to the ringtone being a signal to trigger the body's physical pain blocking mechanism. The people being tested not only felt significantly less pain, but there were also fewer objective signs of pain, such as activity in the muscles used in the facial expression of pain (frowning). In total, 32 people were tested.