If fasting is too difficult for her then it is permissible for her not to fast, and she does not have to take medicine in order to be able to fast.
If a trustworthy doctor has told her that there is the hope of recovery from her sickness, then she must make up the days that she did not fast, and feeding the poor will not be acceptable if she is able to make up those days.
But if the doctor told her that there is no hope that her situation will change, and that fasting will always lead to severe migraines for her, then she may not fast and she should pay the fidyah for the days when she did not fast.
She has to try to work out the number of days that she did not fast since she reached puberty, and pay the fidyah for them.
The evidence regarding it being permissible for a sick person not to fast is the verse in which Allaah says (interpretation of the meaning):
“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, 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. Allaah intends for you ease, and He does not want to make things difficult for you”
This verse applies to the sick person who is able to make up the fasts later on.
But if there is no hope of recovery from the sickness – according to the doctors – then he may not fast and he should feed one poor person for each day, giving half a saa’ of rice and the like (i.e., approximately one and a half kilos). In this case he is like an elderly man who is not able to fast, concerning whom Allaah says (interpretation of the meaning): “And as for those who can fast with difficulty, (e.g. an old man), they have (a choice either to fast or) to feed a Miskeen (poor person) (for every day)” [al-Baqarah 2:184].
Al-Bukhaari (4505) narrated that Ibn ‘Abbaas (may Allaah be pleased with him) said: This applies to the old man and old woman who cannot fast; they should feed one poor person for each day.
Al-Nawawi (may Allaah have mercy on him) said: al-Shaafa’i and his companions said: The old man for whom fasting is too difficult, and the sick person for whom there is no hope of recovery, are not required to fast, and there is no difference of scholarly opinion concerning that. We shall see below that Ibn al-Mundhir narrated that there was consensus on this point. But they have to pay the fidyah according to the more correct of the two scholarly opinions. End quote from al-Majmoo’ (6/261).
We ask Allaah to heal her and make her well.
And Allaah knows best.