Looking at your phone on a slight angle you'll notice a tiny (about 1/16th of an inch) little rectangle just to the right of the speaker on the top, the one right above where it says Motorola. That tiny little square is a light sensor that when you press the phone to your ear it should dim and lock the screen. Possibly try not holding it so flush to your face and maybe angle it away very slightly.
Hope you get this figured out or find and app for it if you can't. Good luck.