I'd like to add to Kostya's Excellent Answer and also Marek's.
Kostya is actually describing a quantum superposition of free photon and excited matter states. Often in this scenario, the refractive index is described as arising from the repeated absorption and re-emission of the vacuum photons by the atoms/molecules of the medium. This is a good first picture, but it's more accurate to describe the situation as the quantum superposition just mentioned. The so called quasiparticle is this superposition, which is the energy eigenstate in the presence of the medium, i.e. the energy eigenstate of the electromagnetic field coupled to the excited matter states. The eigenstate (quasiparticle) is called various things depending on the exact nature of the interaction: polariton, plasmon, exciton, and so forth but, in principle, their essential nature as a quantum superposition of photon and raised matter states is exactly the same in each case.
You can calculate the rest mass of the quasiparticle as well. This is a way of expressing where the energy has "gone to" in the medium: we can move in the frame at rest relative to the quasiparticle and the disturbance has a nonzero energy $m_0\,c^2$ in this frame, representing energy stored in the exited matter states of the medium.
Let's calculate the rest mass of the quasiparticle from $E^2=p^2\,c^2 + m_0^2\,c^4$ and $p = \gamma\,m_0\,v$ with $v = c/n$, with, as usual, $\gamma = \frac{1}{\sqrt{1-{v^2}/{c^2}}}$ is the Lorentz factor. Let's do this from the frame at rest relative to the medium (although, of course, $m_0$ is Lorentz invariant, so we can do a corresponding calculation from any frame). Thus:
$$E^2 = p^2\,c^2 + m_0^2\,c^4=m_0^2\,c^4\left(\frac{1}{n^2\,\left(1-\frac{1}{n^2}\right)}+1\right)=m_0^2\,c^4\frac{n^2}{n^2-1}$$
or
$$m_0 = \frac{E}{c^2}\sqrt{1-\frac{1}{n^2}}$$
For $n=1.5$ (common glasses like window panes or N-BK7 - microscope slide glass) at $\lambda = 500\rm\,nm$, we get, from $E=h\,c/\lambda$, $m_0=3.3\times 10^{-36}{\rm kg}$ or about 3.6 millionths of an electron mass.