Many things can cause this ... a fissure (small cut inside the anal canal), being constipated and straining too much, hemorrhoids or even polyps. It is very important that if you have a lot of blood, or if it's just a little every day take a sample into your doctor immediately. This is how you do it.
You can go to the drug store and get a "sample sheet for stool" from your pharmacist. It looks like a book of matches, but it has tiny little groves in it. Put plastic wrap loosely across the toilet bowl when you have your next bowel movement. With a rubber gloved finger, or a popcycle stick take a small portion of your stool and smear it across the grooved service of the "sample sheet" close tightly, and take it right into your doctor. If they can't see you for a few hours, put this in the refrigerator so it doesn't become contaminated.
Any blood in a bowel movement should be checked out by your doctor. Sometimes there is blood in a bowel movement and you can't really see it.
Good luck Marcy