During the total lunar eclipse the earth, moon and the sun are in perfect alignment so that the moon is within the umbral shadow of the earth. However, instead of turning invisible the moon actually turns red. This is explained in this YouTube video. The short wavelength blue light is said to be scattered away by the earth's atmosphere while the longer wavelength red light is bend towards the moon making it look red. Why doesn't the red light scatter away but instead bend inwards?
The density of the Earth's atmosphere decreases with altitude, so if we looked at a cross section through the atmosphere we'd get something like:
The refractive index of the air depends on the density so we get a refractive index gradient from $n = 1.0003$ at the surface up to $n = 1$ in space, and when a light ray travels in a refractive index gradient it is refracted in the direction of increasing refractive index i.e. downwards towards the ground.
Incidentally this is same reason we get mirages only in reverse. In a mirage the ground heats the air and decreases the air density near the ground. This creates a refractive index gradient where the refractive index increases with altitude, and that makes light rays curve upwards away from the ground.
Anyhow, it should now be obvious why the Earth's atmosphere refracts rays inwards. If we look on a larger scale the light ray trajectory loos something like this:
The refraction makes all light, both red and blue bend inwards towards the Moon. However the blue light is preferentially removed due to Rayleigh scattering so the light that reaches the Moon has an overall red colour.