The most correct view compares pregnant and nursing women to those who are sick, so it is permissible for them not to fast, and all they have to do is make up the days they missed, whether they feared for themselves or their child. The Prophet (peace and blessings of Allaah be upon him) said: “Allaah has relieved the traveller of the obligation of fasting and half of the prayer, and He has relieved the pregnant woman and nursing mother of the obligation of fasting.” Narrated by al-Tirmidhi, 715; Ibn Maajah, 1667; classed as saheeh by al-Albaani in Saheeh al-Tirmidhi, 575.
From Saba’oona Mas’alah fi’l-Siyaam (Seventy Issues related to Fasting).
If a pregnant woman fears that fasting may harm her or her baby, then she should follow the ruling on one who is sick. So she may break her fast and she has to make up the days that she did not fast, because Allaah says (interpretation of the meaning):
“and whoever is ill or on a journey, the same number [of days which one did not observe Sawm (fasts) must be made up] from other days”
“So whoever of you sights (the crescent on the first night of) the month (of Ramadan i.e. is present at his home), he must observe Sawm (fasts) that month”
In most cases, fasting is difficult for pregnant women, especially in the final months, and fasting may affect the pregnancy. So she should refer to a trustworthy doctor for advice.
See al-Sharh al-Mumti’, 6/359.
And Allaah knows best.