While fasting, we are to stay away from such activities that may inadvertently lead to break the fast. Hugging and kissing one's wife with desire is one of those activities to guard against. When someone asked Aishah, whether the Prophet would kiss her while fasting, she said, "yes" but he asked, "who, among you would be able to restrain himself as the Prophet used to?"
The Prophet (peace be upon him) said about fasting: "Fasting is a shield"; but he added, 'as long as one does not break it! The shield is broken if we commit acts that may violate it spirit. Since we are told not to shun sexual gratifications until sundown we are to refrain from the sort of activities you have mentioned.
Having said this, if you happened to kiss your wife while fasting and madhy occurred, your fast is not invalidated.