|MadSci Network: Chemistry|
The key thing to realize is the water boils because it is being pumped on, not because it is being heated. Look at water's phase diagram. With a constant volume, there are two ways to cause water to transition from the liquid to the vapor phase. One way is to increase the temperature, the other is to decrease the pressure.
My chemistry teacher demonstrated this by boiling water twice, once with flame and once with ice. He boiled a flask of water over a bunsen burner, then sealed and inverted the flask and quickly rubbed ice over the former bottom of the flask. The air cooled quickly, dropping the pressure, but the water was still close to boiling temperature, so the small drop in pressure caused it to "cross the line" again and boil a second time.
Now the freezing part. Near the triple point of water, where it is close to being in any of its 3 phases, there is a path by which you can go from liquid to vapor to solid by first decreasing the pressure and then the temperature by relatively small amounts.
When you lower the pressure by actively pumping on a liquid, the molecules that evaporate are those with the highest kinetic energy. (There is always a distribution of energies.) The pump removes the particles, and their energy, from the system. The temperature of the remaining liquid drops as a result. This is called evaporative cooling. Eventually, the remaining liquid gets cold enough to freeze.
By the way, though I have no personal experience with this phenomenon in water, I have seen it happen with alcohol used as a cleaning solution for a vacuum system and insufficiently wiped out. When the residual alcohol started to boil, the pressure stopped going down, and the outside of the steel tube got dramatically colder. Had to heat the tube with a heat gun (science jargon for a hair drier) to get the alcohol boiling away again.
Also happened to me with liquid nitrogen that was used to pre-cool a large superconducting magnet, then was pumped out and replaced with the more expensive liquid helium. Evaporative cooling can also be used to cool liquid helium below its temperature of 4.2K at atmospheric pressure. You boil off quite a bit of your helium, but what's left can get below 3K.
I hope this helps. If you have more questions about thermodynamics, you might want to surf through some educational sites.
Try the links in the MadSci Library for more information on Chemistry.