Sensory nerves are responsible for relaying many types of information; light touch, temperature, pain, vibration, etc. Overlaying another sensation on top of pain gives the nervous system something else to interpret. That's why rubbing your elbow when you knock it makes it feel better.
I've noticed that often light exercise or getting in the pool will decrease my pain. I think it's because my nerves are getting to "think" about something different for a while. The more normal type input you can give your nerves with them tolerating it the better.