All perfect praise be to Allaah, the Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
This person is required to fast if he is able to do so and if he can reschedule the medication times so that he takes the medicine at night. If this is not possible, then he may break his fast and make up for the days that he has missed whenever he is able to do so. If a reliable doctor decides that his illness is incurable, then he is required to provide a mudd of foodstuff to feed a poor person for each day of fasting that he misses. The mudd weighs about 750 grams of rice or similar grains.
Allaah Knows best.