dsanz said:
When light changes its medium of propagation, its speed changes. This causes light to change direction (because of the principle of least action). My question is at the atomic level. The change in the speed of light happens because when an atom absorbs a photon, it then takes a little while to emit a photon.
Well, that's not how it happens, really. Refraction doesn't require that the photons are absorbed and re-emitted. There's a number of ways of looking at it, but with all of them it's best to think about it from a wave perspective, as Abdul here said.
You can describe it at the atomic level, but you don't
need to. The simplest model (using only Maxwell's laws) would be to regard matter as a dielectric continuum. As the light enters, with its time-varying electrical field, you induce a polarization in the dielectric, which then responds in turn. If it helps, you can think of an electrical pulse running into a capacitor, which will briefly become charged, and then discharge, causing the pulse to spread out. Depending on the capacitance (=dielectricity) and the shape/duration of the pulse, different pulses will result in different spreads; which is essentially how dispersion works.
Now, if you want to look at it at the atomic level; are atoms dielectric? Well, yes they are. They have a bunch of negatively charged electrons around them. If you apply an electric field to the atom, they will change their motion and charge distribution accordingly (basically, the Stark effect), and this attenuates the field. When the field disappears, they'll return to their original pattern of motion, and the re-arranging of the charges will induce a field in response. The photon isn't absorbed here; the electrons remain in the same energy state, its just that the state
itself changes in response to the field. At the level of a single atom and a single photon, this is Raman scattering, which doesn't involve the photon being absorbed (as opposed to Rayleigh scattering, which does).
Since electrons can only absorb specific energies, it means that this scattering/refraction occurs in a much wider frequency range than simple absorption would. It's also fairly simple to see that there are limits here: if the wavelength is very long compared to the electron's pattern of motion (or orbital, or "size of the atom" if you like), then you get little polarization and little response; The photon goes right through unhindered - as radiowaves do. On the other end, if the wavelength is very short, the electrons have no time to react to it, and again the photon can pass through without much happening - as x-rays do.