This optical phenomenon occurs because rays of light are strongly bent when they pass through air layers of different temperatures in a steep thermal inversion where an atmospheric duct has formed. A thermal inversion is an atmospheric condition where warmer air exists in a well-defined layer above a layer of significantly cooler air. This temperature inversion is the opposite of what is normally the case; air is usually warmer close to the surface, and cooler higher up. In calm weather, a layer of significantly warmer air can rest over colder dense air, forming an atmospheric duct which acts like a refracting lens, producing a series of both inverted and erect images.