Pain is your body's way of sending a warning signal to your brain that something is wrong. The damaged part of the body produces chemicals that irritate the receptor nerve endings in and beneath your skin. These nerve cells send messages in the form of electrical impulses to the brain by way of the spinal cord, much like wires carrying phone calls to a telephone exchange. The spinal cord acts like a telephone exchange that receives incoming phone calls and switches them to the correct part of the brain. The chemicals are also what causes an injured body part to swell up so that blood will rush to the site and help heal it.
There is more than one kind of pain. "Protective pain" alerts the body to potential danger, such as when you touch a hot burner on the stove. It is usually followed by a reflexive withdrawal of the body part in contact with the source of pain. "Reparative pain" is the dull spreading of pain that accompanies more serious injuries as they heal, such as a broken ankle. "Chronic pain" results from a long-term incurable illness. Nerve fibers become more effective at sending pain signals to the brain, and the brain becomes more sensitive to the pain.
Pain medications try to alleviate pain either by stopping the transmission of signals from the site of the injury, or reduces their intensity before they reach the brain. For instance, taking aspirin will keep nerve cells from making the chemicals that signal pain, and "lower the volume" on the pain signals that do get through to your brain.

