Sounds like two possible options: you have hemorrhoids or you tore part of your rectum during anal sex. Eat lots of fiber, drink lots of water, and take frequent sitz baths. If you continue bleeding, though, especially if the blood is dark in color, you should see your doctor.