How inversions occur
However, it is sometimes possible to find situations where the gradient is inverted, so that the air gets actually colder as you approach the surface of the Earth. This is a temperature inversion. It is most commonly created by the movement of air masses of different temperature moving over each other. A warm air mass moving over a colder one can "shut off" the convection effects, keeping the cooler air mass trapped below. (see capping inversion)
With the disruption of normal convection, a number of phenomena are associated with a temperature inversion. One common effect is the general "stillness" of the air, as is dirty or foggy air which can no longer be pulled away from the surface.
The index of refraction of air decreases as the air temperature increases, a side effect of hotter air being less dense. Normally this results in distant objects being shortened vertically, an effect that is easy to see at sunset (where the sun is "squished" into an orb). In an inversion the normal pattern is reversed, and distant objects are instead streched out or appear to be above the horizon. This leads to the interesting optical effects of Fata Morgana or mirage.
Similarly, radio (being part of the electromagnetic spectrum, like light) can be re-directed by such inversions. This is why it is not uncommon to hear radio (and sometimes TV) broadcasts from seemingly impossible distances on foggy nights. The signal, still more than powerful enough to receive even at hundreds or thousands of miles or kilometres, would normally be refracted up and away from the ground-based antenna, but is now refracted back down instead. This phenomenon is called tropospheric ducting, or a tropo duct.