Solution:The speed of light depends on the optical density of the (transparent) medium in which it is travelling. The optical density of a medium is not the same as its physical density (which refers to the mass/volume ratio). The refractive index is the indicator of optical density of the medium.
The optical density of air depends on its temperature, pressure and humidity. Hence, the speed of light in air depends on its optical density, temperature and pressure. Atmospheric refraction (e.g. mirage) happens due to change in these gradients.