rectal spasms (proctalgia fugax) can cause pain in the rectum. the cause of the spasms is unknown. most people who have rectal spasms have episodes of sharp pain or severe cramps that last from several seconds to several minutes. the episodes may occur several times a year.
treating rectal spasms is not easy to do, because most spasms don't last long enough for any treatment to work. some people find relief by pushing on the anal area with their hand or by sitting across (straddling) something like the edge of the bathtub or a bike seat. soaking in a warm bath may help, but usually the pain goes away before the bathtub is filled. if you have severe spasms, talk to your doctor.