The transitions between solid, liquid, and gas phases that involve the absorption or release of energy.