Due to change in density , light travels fastest in gas, intermediate in liquid and slowest in solid.
This is because light behaves both as a wave and a particle, light comes in the form of photons, literally particles of light much like electrons.
A gas is less dense than a liquid and both are less dense than a solid.
As seen in the diagram the particles in each phase are spread apart differently. Now considering that light is a particle (photon) the particles of light have to move between and around the medium. In a solid the is very little space so photons might not be able to go through or will go through slowly. It is easier in liquids and gases because of the larger spaces.