Hi,
Since the interaction of light as a wave is governed by Maxwell's equations, they also predict that as light enters media different than vaccum, that has properties defined by such constant as a dielectric and magnetic permittivity and permeability respectively, [itex]\epsilon_r, \mu_r[/itex] altering the refractive index, [itex]n = \sqrt {\epsilon_r \mu_r}[/itex].
As light negotiates the denser atomic structure in media other than vaccum, via interactions on the atomic scale, it alters its directions due to a change in its phase velocity. To conserve the laws of propagation, i.e Huygens' and Fermat's principles(of "least time"), the light beam deflects. This is true, by-the-by, for any sort of Electromagnetic radation, and stirctly speaking, for any wave, as all might undergo diffraction and thus alter their parameters.
Hope that explains it simply enough,
Daniel