I think this is to do with dust getting into the sensor that detects your head's proximity to the phone. There's a big thread on it somewhere, and the only fix there appears to be is to blow into the ear price to try and clear the dust, although this is obviously only a temporary fix. Might be worth exchanging your phone for a new one, although its probably unlikely that the same problem won't arise again with the new one.