I usually deal with it on a mental state. I try to take myself out of the moment and stay focused on either a certain thought or feeling not related to physical pain. I learned how to do this by being phsyically abused by my mother, father and older brother right around age 4. After my brother beat me to a certain point when I was 9, I lost most feeling in my left forearm. Beside that, military training gets you used to both pain you'd feel from it being inflicted on you and when working out.
But when I got into Kung-fu, my Sifu did "conditioning" on my body, striking areas of my body, over and over until the pain receptors in my body would be dulled. This mainly came into realization when a car ran into my left leg and the most I did was go "Mrrgh!" and look at the driver. So yeah, at the risk of sounding off, a life time of phsyical abuse, beatings, a stabbing, being shot once got me used to it and I can take my mind out of it.