I had to replace the pressure relief valve this summer. As the hot water heater got up to temp the relief valve would open and it spewed water (several gallons, I'm sure) until everything cooled down enough for the valve to close again.
It was the one time I didn't have my infrared thermometer with me so I couldn't verify the water temperature, but when I ran some into a cup and put it to my lips it was far from boiling hot. So I figured it wasn't the thermostat, and replacing the relief valve fixed the problem.