This is a very good, perceptive question! Yes, of course the optical
artifacts that look like puddles on the road are due to variations in
the refractive index of the air. Some bits of air (like that near the
surface of a road) have different temperatures from other parts of the
air and the air acts a bit like a lens, bending light from its straight
path. The "puddles" are called mirages.
Of course the heating is often due to the sun (it can be due to
other things like the burning of fuel). Sunlight refracts in the
atmosphere just like light from any other source, and so the sunlight
has two roles -- one of which is to heat surfaces and also the air, and
the other is being bent by the differentially heated air to arrive in
various places with various strengths.
One observable consquenece of this is that the disk of the sun is
distorted out of shape as it sets. Sunlight from the setting sun must
travel through many layer of the atmosphere, at differnet temperatures
and pressures, and this may make the setting sun even look as if it is
made up of pancakes of different thicknesses stacked on top of one
another, and even produce little disconnected blobs of light.
It also is a limitation of shining very powerful laser beams from
space to Earth, or from one place on Earth's surface to another. The
laser beam heats the air it travels through, creating a lens which
spreads the beam apart.
Just in case you were asking about sunlight DIRECTLY causing its
own bending, that isn't happening. It's only via the indirect means
that Tom described. mike w
(published on 10/22/2007)