Marijuana inhibits REM sleep. Thusly, no dreams. It also lengthens the time you spend in deep sleep, meaning less time in REM sleep. If you smoke before bed and remember your dreams, it's likely you are remembering them from late-stage REM sleep, where either you're REM rebounding, or its late enough in your cycle that the THC is no longer affecting you.