A prolonged bleeding from rectum and your other symptoms like pain; needs investigations and a physical examination by either a gastroenterologist or a surgeon. The common causes can be;
1) Hemorrhoids or piles (inflamed)
2) Anal fissure
3) Polyp rectum
5) Inflammatory bowel disease like crohn's disease
6) Growth in rectum or colon
Investigations needed to establish the cause are;
3) Barium enema
Read this resource;
I would be happy to assist you further, if you need any more information.
Thanks for using JustAnswer.