It is not a simple problem.
In vacuum, the light is electromagnetic wave - nothing else. When it strikes a dense material, which is made of atoms, molecules; electrons and nuclei, the electromagnetic field of light and the particles of the matter interact. The electric field polarizes the molecules/atoms, by acting in opposite directions on the negative electrons and the positive nuclei. The induced dipole moment vibrates with the frequency of the light and generates electromagnetic waves, that interfere with the original one. The whole thing is electromagnetic field and mechanical vibration of charged particles, propagating. Why should be the speed of propagation stay the same as that of the light in vacuum? It is a different kind of wave.
In textbooks, you find how the permittivity ε of the material can be derived using the induced dipoles, and also it is shown that the speed of the electromagnetic waves is v=1/√(εμ). Far from absorption bands where the frequency of light is close to the frequency of vibration of the electrons/ions, ε is greater in the material than in vacuum, so the speed of light gets slower. But near a resonant frequency, ε gets complex, and the light being absorbed, also has higher phase velocity than in vacuum.
For very young students I would explain why the light slows down in matter with a simple analogy. Imagine you walk wit 5 km/h on a smooth road. But you have to cross a wood. There are trees everywhere, so you can not go straight ahead any more, you have to bypass a tree in your way every now and then. You can not go straight ahead: you go zig-zag while trying to keep the direction of travel, so the average displacement is a straight line. But, in spite you walk with 5 km/h speed, the component of your velocity along that straight line is less.
ehild