Can I Pray after Miscarriage?
Question

I was pregnant and I had a miscarriage after two months. I asked a lady who is knowledgeable about Islam whether I should fast Ramadan and pray, and she answered: “Yes, fast and pray, because the soul had not yet been breathed into (the embryo), so it is regarded as Istihadah (non-menstrual vaginal bleeding).” So I fasted and prayed, but then another doctor told me that I should repeat the fasts. What is the correct ruling?
Praise be to Allah.The different opinions that our sister has heard are the result of scholarly differences on this matter. The correct scholarly view is that if a woman miscarries a foetus that was fully formed, then she should stop praying and fasting because this is postpartum bleeding.
If the foetus was not fully formed, then her blood is irregular bleeding and she should not stop praying and fasting . The minimum time in which the foetus becomes fully formed is eighty-one days (from conception). 
The scholars of the Standing Committee said: 
“If the foetus was fully formed, in the sense that its limbs (hands and feet) and head had appeared, it is prohibited to have intercourse with the woman so long as she is still bleeding, for up to forty days. It is permissible to have intercourse with her at times when the bleeding stops within forty days, after she does Ghusl. 
But if the limbs had not yet appeared in the embryo, then it is permissible to have intercourse with her even if that is immediately after the miscarriage, because that is not regarded as postpartum bleeding, rather it is irregular bleeding and she can pray and fast in that case .” (Fataawa Al-Lajnah Ad-Da’imah, 5/422, 423) 
Shaykh ‘Abd Al-‘Aziz ibn Baz (may Allah have mercy on him) said: 
If a woman miscarries something in which human features such as a head, arm or leg etc., can be distinguished, then the rulings of postpartum bleeding apply and she should not pray or fast , and it is not permissible for her husband to have intercourse with her until she becomes pure or until forty days have passed. If she becomes pure before forty days have passed, then she has to do Ghusl and pray and fast in Ramadan, and it is permissible for her husband to have intercourse with her. 
But if no human features can be distinguished in what is passed by the woman, and it looks like flesh with no distinguishable features, or it is blood, then she comes under the ruling of one who is suffering from Istihadah (non-menstrual vaginal bleeding), not the rulings on postpartum bleeding or menstruation. So she has to pray and fast in Ramadan, and she is permissible for her husband… because this comes under the rulings on Istihadah according to the scholars.” (Fatawa Islamiyyah, 1/243) 
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said: 
The scholars said: If what is passed has clear human features, then her bleeding after that is regarded as postpartum bleeding, so she should stop praying and fasting , and her husband should avoid her until she becomes pure. If what comes out is unformed, then it is not regarded as the blood of postpaetum, rather it is irregular bleeding which does not prevent her from praying or fasting, etc. 
The scholars said: The earliest time at which distinguishable features may appear is eighty-one days.” (Fatawa Al-Mar’ah Al-Muslimah, 1/304, 305) 
And Allah knows best.