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.
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.