All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
If a person is sick and he is not able to fast or fasting may delay his recovery, then he may break his fast. Allah, the Exalted, says (what means): {So whoever among you is ill or on a journey [during them] – then an equal number of days [are to be made up].} [Quran 2: 184]
If he fasted but then needed to break his fast (because of his sickness), he could break his fast with eating or drinking. However, there are two different views on whether he may break his fast with sexual intercourse. Both views are narrated from Ahmad. The soundest view is that the person in hand may break his fast with sexual intercourse and that there is no expiation on him.
Ash-Sharh Al-Kabeer reads:
The second view is that he does not have to observe the expiation. This is the view preferred by our Shaykh, and it is the sound one. This is also the view maintained by Ash-Shaafi‘i. This is because such a person is not required to fulfill the fast just as the case in voluntary fasting, and; therefore, there should be no expiation on him. If the person is sick and he is allowed to break his fast, then he should be treated as the travelling person by way of analogy.
Meaning that just like the travelling person, the sick person is allowed to break his fast with sexual intercourse.
If the sick person does any of the things that invalidate fasting, his fasting will become invalid and he is required to make up for the day if his sickness is curable. If his sickness is chronically incurable, then he is required to feed a poor person for each day of fasting he comes to break.
It should be noted that if the person’s sickness is not so serious that he will be able to fast and fasting will not delay his recovery or affect his health condition, then he is not allowed to break his fast. Consequently, he is not allowed to invalidate his fasting with sexual intercourse. If he does, he must observe the expiation.
Allah knows best.