hi LindaG, sounds like you are experiencing this thing called proctalgia fugax which is discribed as uncontrolled spasm or contraction of the muscles in the rectal area and pelvis. The cause is not known. It is not caused by hemorrhoids, fissures, polyps, or other rectal conditions. Sufferers often describe waking up from a sound sleep with a sharp pain, often described as stabbing pain "like a knife sticking deep in the rectum." Mercifully, the pain is usually brief - lasting less than 20 minutes - and disappears as mysteriously as it comes. fortunately, the people who experience this should be confident that the pain is not an indication of something serious. Also, this condition does not increase the risk of colon cancer, colitis, hemorrhoids, anal fissures or other bowel disorders. It is simply a muscle cramp in the wrong place at the wrong time. There is no cure. The attacks are too short for any medical therapy to be effective. There is no surgical procedure that has been shown to be effective. The most common therapy is simply pushing on the anal area. This may be done manually or by straddling the edge of a bathtub. Soaking in a warm bath may help, but usually the pain begins to subside before the bathtub is filled. Sadly there is no way to reliably prevent further attacks. Some doctors feel that a high fiber diet and plenty of fluids helps keep the stools soft and prevents spasm. The best plan is to let your doctor rule out any other serious disorders and be happy that nothing more important was found.
I hope this info helps. good luck!