Endorphins are natural painkillers produced by the body.
The protein molecules bind to receptors in the brain and spinal cord to stop messages of pain and create an analgesic effect. In the treatment of back pain, electrical stimulation has been shown to promote the release of endorphins. Likewise, aerobic exercise for a prolonged period of time is thought to increase the production of endorphins.
The release of endorphins probably creates the "runner's high" that occurs during exercise.