Imam al-Shafi'i (may Allah have mercy on him) writes in the book Ahkam al-Qur'an that whoever comes to his wife while she is menstruating, or after the blood has stopped while the woman has not yet taken the ritual bath, should seek forgiveness from Allah and not do it again until the woman becomes pure and prayer becomes permissible for her. Although some other reports have been narrated on this subject, if they were established we would take them (that is, act upon them), but (the hadiths) like it are not established.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحيض / 1530