Ruling on Dreaming of Having Sex in Islam
Question

In my dreams i have people chasing me, sometimes its members of my family, sometimes people i dont know.it may sound wierd but its true. in such dreams i tend to fly up into the sky 2 escape from them and have been successful in doing so.does this mean Allah takes my soul and makes it actually fly.and also recently i had a dream in which an unknown man was having intercourse with me.i was shocked 2 have such a dream, did Allah take my soul then or was it another trick by shatan.
Praise be to Allah.What to do if you see unpleasant dreams?
These and similar unpleasant dreams come from the Shaytan. What is prescribed for the Muslim, if he sees a dream that he dislikes, is to spit drily to his left three times and to seek refuge with Allah from the Shaytan and from the evil of what he has seen, three times, and he should turn over onto his other side. Then it (his dream) will not harm him. And he should not tell anyone about it , because the Prophet (peace and blessings of Allah be upon him) said: “The good dream comes from Allah and the bad dream comes from the Shaytan. So if any one of you sees a bad dream which frightens him, let him spit drily to his left and seek refuge with Allah from its evil , then it will not harm him.” (Narrated by Al-Bukhari, Bad’ Al-Khalq, 3049) 
Dreaming of having sex in Islam
If a woman sees in a dream that someone is having intercourse with her, this is something natural, for women may experience erotic dreams just as men do. An erotic dream (or “wet dream ”) is when one imagines doing sexual acts in one’s dream. 
It was narrated in a Hadith that Umm Salamah (may Allah be pleased with her) said: “Umm Sulaym came to the Messenger of Allah (peace and blessings of Allah be upon him) and said, ‘O Messenger of Allah, Allah is not too shy to tell us the truth. Does a woman have to do Ghusl if she experiences an erotic dream ?’ The Prophet (peace and blessings of Allah be upon him) said: ‘(Yes), if she sees some wetness.’” (Narrated by Al-Bukhari, Al-`Ilm, 127). 
Shaykh Al-Bassam (may Allah have mercy on him) said that the word ihtamalat (translated here as “she sees an erotic dream”) refers to whatever a sleeper may see in his dreams, and what it means here is if a woman sees in her dream what men see of images of intercourse and the like.
If a woman sees such things in her dream, then if something comes out of her as a result of that dream, she has to do Ghusl.  But if she simply sees a dream and nothing comes out of her, then she does not have to do Ghusl , because the Prophet (peace and blessings of Allah be upon him) said, “If she sees some wetness.” (See Tawdih Al-Ahkam, 1/297)
And Allah knows best.