That is true of any transparent medium though; all materials consist of atoms, and spaces between atoms (which are effectively a vacuum, or there would be an atom there)
How light travels though a transparent medium isn't technically the same as when photons are absorbed and re-emitted in the discrete particle model, but that has no explaination for the change in speed at all - only when you start looking at the problem though the lens of wave probability theory and electron shells, does any explaination emerge, and in that domain, the diference between a photon "passing though, but slowly" and "being absorbed and re-emitted" isn't that great.
Well, my own theory is that the speed of Magic is involved. Magic in air is clearly not anywhere near lightspeed (given magic bolts can be dodged) but by terrestial standards, can still be pretty fast (given lightning bolts can also be dodged; Dashie does this on occasion). So my theory is that, as the pressure cone forms around Dashie's hooves when she approaches transition speed, she is actually catching up to her own magic (her "wingpower") as she projects it into the air in front of herself; at transition, she shatters that field entirely and only the fact that magic propagates faster though ponies (pegasus and presumably unicorn) than air stops her from suffering severe friction burns as she loses her protective shield (which also would explain why the wonderbolts and Rarity aren't severely hurt when she hits them at a serious multiple of the speed of sound, and changes their vector to be first parallel to the ground, then skywards....)
but Heaviside teaches that the phenomena of a mach cone and Cherenkov radiation aren't that different, so extending that to Equestrian (in this case, wingpower) magic would seem reasonable, given how visibly similar a rainboom is to a sonic boom or transluminal effects.