What is the Islamic ruling about the wet dream during fasting? Tell me about the masturbating during fasting in light of Shari'a?
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 is His slave and Messenger.
Having wet dreams during the daytime of Ramadan does not affect the validity of fasting, as the person cannot prevent it as it is out of his control. It is known that Allah does not burden people for that which is beyond their power.
Allah Says (what means): {Allah does not charge a soul except [with that within] its capacity.} [Quran 2:286]
What is harmful during Ramadan is deliberate ejaculation through masturbation, sexual intercourse, etc.
So, ejaculating deliberately in Ramadan nullifies the fasting. Abu Hurayrah narrated that the Prophet said: “Every (good) deed of the son of Adam would be multiplied, a good deed receiving a tenfold to seven hundred fold reward. Allah, the Exalted and Majestic, has said: With the exception of fasting, for it is done for Me and I will give a reward for it, for one abandons his desire and food for My Sake." [Al-Bukhari and Muslim]
The masturbating person did not abandon his passion desire for the sake of Allah. This is the opinion of the majority of the scholars.
As a result, you should make up the days in which you masturbated. If you do not know their number, then you should fast until you believe that you have fasted at least all the days that are due on you.
As for expiation, you are not required to give any expiation as there is no evidence supporting that, and comparing sexual intercourse to masturbation is a big mistake as they are very different because having sex is greater and more dangerous. So, masturbation cannot take the ruling of sexual intercourse. Now you should repent to Allah, perform as much good deeds as possible and stay away from anything that could seduce you.
For more benefit, please refer to Fataawa 20726, 83341, 85599, and 86599.
Allah knows best.
You can search for fatwa through many choices