there are techniques. Watch the movie Waking Life for a good view on lucid dreaming.
One technique is identifying what is possible in a dream. Lights for instance. Light is always constant in a dream. So every time you are in a room, you should flip the light switch on and off. This is to assure you arn't dreaming. Eventually this will become second nature to you. So if you are dreaming, you flip a light switch and nothing responds, your mind knows it's dreaming.
This ofcourse is an extreme example. But you need subconsiously look at cues as to when you are dreaming. And eventually your mind will do it on it's own. (hopefully)
But I can't attest to this working.