Both whales and people use lungs and noses to breathe air. But because whales live in the water their noses (on the tops of their heads) and lungs work differently from ours; they breathe only when they are on the surface of the ocean.
That means they have to take in and let out a lot of air quickly. Their lung muscles are strong enough to force almost all the air out at once. One breath just about empties their lungs. When it comes to the surface after a dive, it breathes out the “old” air from its lungs quickly, all in one breath with such force that the air travels straight up from about 10 to 40 feet. This air is usually warmer than the air just above the surface of the ocean, so the water vapor condenses.
This condensed water vapor looks like steam – the same thing happens when you “see your breath” on a cold winter day. So the “spout” you see is not a fountain of water; rather, it’s a stream of warm air being forced out of the whales lungs, aka the whale’s breath. Some whale watch guides can tell you the kind of whale that has just come to the surface, even before they see the animal, based on the height and shape of their spout – in this case, the humpback.