Praise be to Allah.
We ask Allaah, the Lord of the mighty Throne, to heal you and to reward you.
In the answer to question no. 12488 we described the kind of sickness which makes it permissible for a person to break the fast. This is any sickness that causes intense hardship for one who fasts, or there is the fear that his sickness may become worse or his recovery may be delayed if he fasts. If your situation is like this, then it is permissible for you not to fast in Ramadaan.
If you can take the medicine once when breaking the fast and once at sahoor, then this is what you have to do, and it is not permissible for you to break the fast in that case, because there is no excuse that makes it permissible not to fast.
But if that is not possible, and you have no choice but to take the medicine during the day, then it is permissible for you not to fast.
With regard to giving charity instead of fasting, you have to refer to trustworthy doctors. If there is the hope of recovery from your sickness, then you have to make up the fasts and it is not permissible for you to feed others instead, because Allaah says (interpretation of the meaning): “but if any of you is ill or on a journey, the same number (should be made up) from other days” [al-Baqarah 2:184]. So you should wait until Allaah heals you then make up the days that you did not fast.
But if there is no hope of recovery from your sickness, then you do not have to make up the missed fasts, and you have to feed one poor person for every day.
It should be noted that what is required is to give food, and giving money instead of food does not count. This has been explained in the answer to question no. 39234
And Allaah knows best.