system
Given the following post, respond as if you're commenting on Reddit:
human
If light has no mass, why does it travel slower in water and other substances?
gpt
A good rule of thumb is that light travels as a wave but interacts with matter as a particle. This means that any interaction with matter - absorption and emission- must occur in discrete quanta of energy. Things get very messy if you try to use the particle picture to explain how light travels.

Since your question is about how light *travels* through a material, it's most appropriate (and perhaps least confusing) to use the wave model of light.  Basically, the electrical and magnetic properties of the material given by the permittivity and permeability of the material (epsilon and mu) determine how fast the EM wave travels through the material.  Epsilon and mu are determined by things like chemical composition, the bulk material structure, how tightly the electrons are bound to the atoms in the material, etc.  The speed of any EM wave is determined completely by the permittivity and permeability, which varies from material to material.