What's the physics behind XKCD #2027 (time between lightning flash and radio wave burst)? XKCD usually has solid (and often contemporary) science behind it. Lightning Difference, #2027  one says:

Q: What’s that trick for telling how many miles away lightning is? A: Just count the seconds between the visible flash and the radio wave burst, then multiply by 5 billion.

Usually it's lightning versus thunder, and you divide the time by 5 (or thereabouts) to get the distance in miles.
Here though, light time for 1 mile (about 1600 meters) would be about 5.3E-06 seconds, and if the difference between the visible light flash and the radio burst were one five-billionths of a second (2E-10 seconds), that suggests a velocity difference of about 38 ppm.
What is the physics behind that 38 ppm difference?

A: The question of "why" radio waves have a lower speed in air than light might be due to the interactions of radio waves with diatomic molecules ( O1 and N1 ). The radio photons energy are going to be closer to the "available" transition energy for rotations. The Hyperphysics page has a discussion. Think of it as the cumulative effect of many photons causing transitions, but the molecules are then re-emitting the photons with a slight delay.
Visible light has a much higher energy per photon and the probability of an interaction with the rotational modes of diatomic molecules is much lower, so the gas is less "prismatic" to visible light. (I changed the adjective describing refractivity from "transparent" to "prismatic" since transparency could also describe the absorptive index.
This page give the refractive index of various gases for visible and radio frequency photons.
I was happy to find that Feynmann's blackboard was photographed and transcribed in a discussion of the semi-classical underpinnings of refraction, but with a footnote that references the QM basis.
A: I think it's fair to say that explainxkcd.com is the authoritative source for questions regarding xkcd. In this case, a detailed discussion (including formulas) is taking place on the page for xkcd 2027. 
Here's a quote from its current text:

According to Wikipedia
  and other sources,
  refractive index of air at 0°C is about 1.000277, which equates to
  a speed of light around 299709.4 km/s (186230.8 miles/s). According to
  this paper,
  refractive index for radio waves in similar conditions is 1.000315,
  which equates to a speed around 299698.1 km/s (186223.7 miles/s). This
  means that to get the distance, the time difference in seconds between
  visible flash and radio burst should be multiplied by about 4.9
  billion for miles, or about 7.9 billion for kilometers.  More details
  for the calculations are in the comments below.


As for why radio waves are slower in air than visible light - I don't know, and I didn't find any useful sources, but I guess it's because even in the troposphere some molecules are ionized, and the free electrons affect radio waves much more than waves of higher frequencies. What I read about the ionosphere and dispersion due to free electrons in the interstellar medium seems to support that idea. But it's just a guess - I may be completely wrong. 
A: Well, without researching this at all, I’m going to go out on a limb and say it’s due to the difference in refractive indexes between visible light and radio waves in air.  Air has dispersion like everything else, and so electromagnetic waves of different frequencies travel at different speeds through it.  If you know the difference in refractive index, you can compute the time delay per mile. 
A: Note that the explanation from explainxkcd.com is not entirely correct. Not completely wrong but they make the common error to confuse the group index with the refractive index. 
It is the group index that is responsible for the delay of a burst, not the refractive index! *
While in air the group index differs only slightly from the refractive index, in the RF domain, where are many resonant absorption lines due to water, the group index can differ significantly from the refractive index. Also due to absorption lines, the group index is itself strongly frequency dependent in the RF domain.
The actual delay that is observed for a RF wave hence depends on H2O concentration and also on the actual frequency distribution of the wave packet. There is also the influence of the ionosphere.
I found this thesis which does an experimental study of the delay between the lighting and the receive of a frequency burst. Although it is not strictly RF domain, but at lower frequencies, they find different group velocities depending on the environmental conditions (e.g. day vs. night). At least I understand it that way.
*) In fact the refractive index can be below one or even negative without any violation of relativity ("no information can travel faster than the speed of light in vacuum"). The phase propagation (the refractive index refers to phase velocity) is not able to carry any information. Information propagation requires a modulated wave and there the group velocity (and group index) comes into play.
EDIT: Strictly speaking the group velocity is also not always the speed a wave packet travels. This is only true in weakly absorbing media.
Since air qualifies as weakly absorbing the group index is in my opinion indeed the right quantity for the problem here, but for completeness I will explain the full story:
Group velocity is the velocity of the envelope of a wave packet. If the absorption is so strong that the shape of the wave packet envelope itself changes during propagation, then group velocity is no longer appropriate to describe the propagation speed. One the other hand it is very difficult to asses the speed of something that changes its shape during propagation. That is why there are other definitions of velocity. Depending on the criteria one uses there is e.g. Front velocity or velocity of energy transport. The velocity that can never exceed the speed of light in vaccuum is the Front velocity. However this is also a bit difficult to work with, both experimentally and theoretically.
As references to the topic one has the book by Brillouin and Sommerfeld "Wave Propagation and Group Velocity" (1960) and the article "The Velocities of Light" by R. Smith (1970) (Thanks to David for pointing this out).
