An altitude compensating nozzle is a class of rocket engine nozzles that are designed to operate efficiently across a wide range of altitudes.
The basic concept of any engine bell is to efficiently direct the flow of exhaust gases from the rocket engine into one direction. The exhaust, a high-temperature mix of gases, has an effectively random momentum distribution, and if it is allowed to escape in that form, only a small part of the flow will be moving in the correct direction to contribute to forward thrust.
An engine bell works by confining the sideways flow of the gases, creating a local area of increased pressure with a region of lower pressure "below it". This causes the gases to preferentially flow in the direction of decreasing pressure. By careful design the engine bell grows wider so that the pressure decreases in such a way that by the time the exhaust flow has reached the exit of the bell, it is traveling almost completely rearward, maximizing thrust.
The problem with the conventional approach is that the outside air pressure also contributes to confining the flow of the exhaust gases. At any given altitude, which is to say, at any given ambient air pressure, the bell can be designed to be nearly "perfect," but that same bell will not be perfect at other pressures, or altitudes. Thus, as a rocket climbs through the atmosphere its efficiency, and thus thrust, changes fairly dramatically, often as much as 30%.
Altitude compensating nozzles address this loss of efficiency by changing the shape or volume of the rocket nozzle as the rocket climbs through the atmosphere. There are a wide variety of designs that achieve this goal, with the aerospike being perhaps the most studied among them.