page 42
Heat builds up during the day because the amount of visible and infrared (IR) radiation from sunlight exceeds the amount of long wavelength infrared radiation (IR) re-radiated and lost from the earth's surface. Therefore, the earth's surface warms up, which in turn warms up the air next to the earth, thus the air temperature increases close to the earth's surface.
The earth's surface slowly looses heat by re-radiating long wavelength infrared (IR) radiation, thus the solid objects of the earth's surface cool. This in turn decreases the air temperature next to the earth's surface.  If enough energy is lost to drop the temperature below freezing, a frost occurs.  Thus, a freezing layer of air occurs next to the earth's surface with a warmer layer of air just above it (about 10-15 feet), which results in the development of a temperature inversion.
The conditions for this to occur are: a) night, b) no wind, and c) no cloud cover.