Sheikh Riyâd al-Musaymîrî, professor at al-Imâm University in Riyadh
The Prophet (peace be upon him) divided dreams into three categories.
Abu Hurayrah related that the Prophet (peace be upon him) said: “Dreams are three categories: the good one a glad tiding from Allah, a bad dream from Satan, and a normal dream which exposes what the person thinks. If you see what you dislike, get up and pray and do not mention it to others.” [Sahîh Muslim]
In another hadîth related by Abu Qatâdah, the Prophet (peace be upon him) said: “A good dream is from Allah and the bad one from Satan. If any of you sees what he dislikes, he should spit on his left side three times and seek refuge from Allah against its evil then it will not hurt him.” [Sahîh Muslim]
In another narration related by Jâbir, he says: “The person should turn on his other side.” [Sahîh Muslim]
Therefore, if someone tells you about a bad dream, mention to him the above hadîth, in which our Prophet (peace be upon him) forbade telling others of the same and advise him to read the prescribed supplications before going to sleep.
Source: Islam Today