Hi,
Thanks for using JustAnswer!
Often you have been thinking about that person even if subconsiously during the day and your mind is still thinking about them at night. Just as in the day when you randomly think of someone that can happen in your dreams.
http://www.som.org/1dreams/why.htm
Hope this helps!
Licensed Clinical Social Worker
BSW, MSW, LCSW