Myself, sometimes when it happens, try to convert it to pleasure. kinky as it may sound, it seems to work for me anyways. Pain receptors and pleasure receptors to the brain must be closely linked, without going into detail. Focusing intently, enough to at least or fully dull, what at times can be excructiating stuff. How do you deal with it?