Sahih Muslim Book 003, Hadith Number 0658.
Chapter : The woman who has a prolonged flow of blood, her bathing and prayer.
On the authority of 'Aisha: Umm Habiba asked the Messenger of Allah (may peace be upon him) about the blood (which flows beyond the period of menstruation). 'Aisha said: I saw her wash-tub full of blood. The Messenger of Allah (may peace be upon him) said: Remain away (from prayer) equal (to the length of time) that your menses prevented you. After this (after the period of usual courses) bathe yourself and offer prayer.