Water responds like any other compound to changing temperatures, but an anomaly occurs in a narrow range around the melting point, and it's a change that makes a big difference. When you heat ice, the molecules gain kinetic energy, and the ice expands until it melts. But once all the ice has turned to water and the temperature starts rising again, expansion stops. Between 32 and 40 degrees Fahrenheit (0 and 4 degrees Celsius), the melted water actually contracts as the temperature rises. Beyond 40 F (4 C), it starts to expand again. This phenomenon makes ice less dense than the water around it, which is the reason why ice floats.
TL;DR (Too Long; Didn't Read)
Ice expands at a fixed rate, liquid water expands at an accelerating rate with increasing temperature and steam again expands at a fixed rate. Between the temperatures of 32 F (0 C) to 40 F (4 C), liquid water actually contracts with increasing temperature.
Expansion of Ice, Water and Steam
As a solid, ice can only expand linearly, which means the length and width of an ice cube can change. The coefficient of linear expansion for ice, which measures fractional change of length and width per degree Kelvin, is a constant 50 x 10-6÷ K. This means that ice expands in a uniform amount with each degree of heat you add to it.
When ice becomes liquid water, it no longer has fixed linear dimensions, but it has volume. Scientists use a different thermal coefficient -- the coefficient of volume expansion -- to measure the response of liquid water to temperature. This coefficient, which measures fractional changes in volume per degree Kelvin, is not fixed. It increases with mounting temperature until the water starts boiling. In other words, liquid water expands at an increasing rate as the temperature goes up.
When water turns into steam, it expands according to the ideal gas law: PV = nRT. If the pressure (P) and number of moles of vapor (n) maintain at a constant, the volume of steam (V) increases linearly with temperature (T). In this equation R is a constant called the ideal gas constant.
The Crucial Anomaly
At its melting point, water exhibits a characteristic shared by no other compound. Instead of continuing to expand in the liquid state, it contracts, and its density increases until it achieves a maximum at 40 F (4 C). From the melting point to this critical point, the coefficient of expansion is negative, and at the point of maximum density, the coefficient of expansion is 0. If the temperature continues to rise, the coefficient of expansion again becomes positive.
If you reverse the temperature gradient and cool water to the freezing point, it starts expanding at 40 F (4 C) and continues to expand until it freezes. This is the reason water pipes burst in freezing weather and why you should never put a glass bottle full of water in the freezer.