A stomach ulcer or an intestinal ulcer is the major cause for the severe pain before a bowel movement. Initial stages of ulcer have only less pain but later stages cause a severe pain. Many naturopathy therapies are available to get rid of it.
It depends on what kind of pain you are experiencing before the bowel movement. If the pain persists for a few weeks or if your experiencing bleeding also, you should go to a G. I doctor.
You could be suffering from colitis, which is a big sign of this. In addition, you could have a problem with your colon or anus. Best thing to do is go to your physician.
Most common is chronic constipation. Active internal or external piles, fistula, fissure, carcinoma, colitis and Crohn's Disease are other causes. Barium meal follow up and colonoscopy can give correct diagnosis.
If there is only pain and no blood involved, then you likely are not eating enough fiber. Either eat more whole grains in your diet, or start taking fiber supplements. If there is some blood, it could be hemorrhoids. This can be treated with a cream like Preparation-H.