Possibly by sending electric impulses onto the head that replicates neuron's firing during REM, or by simply stating while the person is in REM what is to be dreamed.