Hello Sharmila and thanks for writing in at HCM
The bleeding after motion is mainly due to infection in the digestive track usually colon ans intestine unless you have a history of hemorrhoids or fissure but pain is present in both the cases. The main cause for this is improper diet or unhygienic diet, constipation
For the treatment you need a course of antibiotic and high fiber diet with some stool softer (if needed). Consult you doctor and follow the advises, If bleeding does not stop after treatment than you may need Colonoscopy
to check the course of bleeding.
Best Wishes and have a speedy recovery