Pain in the opening to the rectum anus can be caused by diarrhea or constipation or by scratching a rectal itch. A common cause of anal pain is a tear in the lining of the lower rectum anal fissure. This type of anal pain usually goes away when the problem clears up. Injury during anal sex or from an object being placed in the rectum also can cause pain. A rare cause of anal pain is spasms of the muscles in the rectum. Some of these conditions may cause some light bleeding.