Muslims are required to safeguard their fasting against anything that may invalidate it or affect its perfection. However, a Muslim will not be held accountable for things that involuntarily happen to him or her, especially if they are due to health problems.
Concerning this particular issue, Sheikh MuhammadSalih Al-Munajjid, a prominent Saudi scholar said,
Acid reflux is something that happens involuntarily. A person may feel some acidity or bitter taste in his esophagus but it does not reach the mouth. In this case it is not regarded as one of the things that invalidate the fast, because it does not come out to the mouth.
However, if it comes out to the mouth, then in that case it comes under the ruling on qalas (reflux) or vomiting.
The word qalas was interpreted as vomiting, or as a small amount of vomit that reaches the throat but does not fill the mouth. It was said that it was that which is regurgitated by the stomach when it is full. (See Al-Majmoo` by al-Nawawi, 4/4)
The ruling on this is that if it is returned to the stomach when it could have been expelled, this breaks the fast, but if a person swallows it because he is unable to expel it, then it does not affect the fast.
In al-Sharh al-Sagheer (1/700) it is said concerning qalas, “If a person is not able to expel it, as when it does not pass the throat, then he does not have to do anything.”
Ibn Hazm said in al-Muhalla (4/225), “Reflux that comes out of the throat does not invalidate the fast, so long as the person does not deliberately swallow it back after it reaches the mouth when he is able to expel it.”
In al-Muntaqa Sharh al-Muwatta’ (2/65) it is said,
It was narrated from Malik that he said, “Whoever burps and reflux reaches his mouth but he swallows it back does not have to make up that day of Ramadan.” Ibn al-Qasim said that Malik said, “If it comes out to a place where he can expel it if he wants to, but then he swallows it back, then he has to make up that fast. If he suppresses it before that, then he does not have to do anything.”