Janabah During the Fast
Question :

If I am fasting and I slept and had ejaculated semen, what do I do so my prayers will not be invalid?

Answer :

You should perform the ghusl of janabah before you can pray, and the fast is not affected.

Masturbation
Question :

Does masturbation during the month of Ramadan void the fast, if it does not end with ejaculation?

Answer :

If he intended to break the fast by such an act, his fasting is invalidated, whether or not ejaculation took place. He would then have to make it up later as qadha as well as pay the kaffarah. If he did not intend to break the fast, his fasting is not void. In any case, it is prohibited for the individual to masturbate even if it does not end with ejaculation. If one does so, he is required to seek the forgiveness from Allah Almighty and repent to Him.

Discharge of Semen after Fajr
Question :

I was fasting and after Fajr prayers some semen was discharged with urine. I performed the ghusl of janābah about three to four hours later. Is my fast valid?

Answer :

Your fast is in order.

Fasting and Masturbation
Question :

What is the ruling on masturbating during fasting of fasts other than the month of Ramadan, such as fasts obligated due to vows and non-obligatory fasts? Does masturbation also invalidate the non-Ramadan fasts?

Answer :

Masturbation is prohibited at all times, and invalidates all types of fast if semen is ejaculated.

Ejaculation in Ramadan
Question :

If I have sexual thoughts during my fast, and masturbate without the intention of ejaculation, but I do end up ejaculating, is my fast still valid?

Answer :

The fast will not be valid, and will need to be made up on another day as qadha. You will also be required to pay the kaffarah, if you anticipated that you would ejaculate. If you were sure and confident that you will not ejaculate, there is no kaffarah.