Praise be to Allaah.
The Muslim has to protect his fast from things that may invalidate it, and he has to seek reward by giving up his desires for food, drink and intercourse, as Allaah says in the hadeeth qudsi concerning the virtues of fasting: “He gives up his food, his drink and his physical desires for My sake.” (Narrated by al-Bukhaari, al-Sawm, 1761). But if he can control himself and not slip into that which would cause his fast to be invalidated, by the emission of maniy (semen) or by having intercourse, or would make his fast imperfect by the emission of madhiy (prostatic fluid), then it is permissible for him to embrace his wife in this case, because the Prophet (peace and blessings of Allaah be upon him) used to fondle ‘Aa’ishah (may Allaah be pleased with her) but he used to control his desire.
Shaykh ‘Abd al-‘Azeez ibn Baaz said:
A man may kiss, embrace and touch his wife, without having intercourse, when he is fasting. This is permissible and there is nothing wrong with it, because the Prophet (peace and blessings of Allaah be upon him) used to kiss and touch his wives when he was fasting. But if there is the fear that he may do something that Allaah has forbidden because his desire is aroused quickly, then it is makrooh for him to do that. If he ejaculates he still should not eat or drink for the rest of the day, and he has to make up the fast, but he does not have to offer kafaarah (expiation) according to the majority of the scholars. But madhiy (prostatic fluid) does not invalidate the fast, according to the more correct of the two scholarly views, because the basic principle is that the fast remains valid, and because it is too difficult to avoid. And Allaah is the Source of strength.
Fataawa al-Shaykh Ibn Baaz, part 4, p. 202