You have to break your fast when you are sick and the pain becomes unbearable. If you know you will have pain or a doctor recommends you don’t fast you would be excused from fasting. However if the pain is bearable, you should try to fast and if it becomes too difficult You can break your fast. If you break the fast you would have to give the fidya, which is 3/4 if a kilo of food to the poor for each day (that is if you were not able to make it up within one year).
My advice is to practice the fast before the month of Ramadan. As in train your body to fast in rajab and Sha’baan. You have to try to wake up for suhur, have your tea or coffeee and maybe even take the pill. I know people who had this problem and they treat it this way by eating at suhur and starting the fast before the first day of Ramadan.