It is called a mirage. IIRC, it happens because the hot air next to the ground is less dense than the cooler air above, and so light gets refracted upwards.
Those inversion layers are also responsible for a high percentage of UFO reports. The image can turn up anywhere within reason, such as a hundred feet off of the ground.