Marek's answer is summarised shortly as "no". It is based on the most "fundamental" concepts of physics -- you got fundamental quantum particles -- photons, electrons and some others. And these particles interact with each other producing all the world around us. The properties of the particles, like their mass, charge, e.t.c. doesn't change whatever you do with them. And, therefore, the mass of the photon is always zero.
This appoach is very intuitive and of course the answer is correct...
But one can look at the same problem from different perspective, obtaining a different answer:
Those fundamental particles are just excitations of the vacuum -- the universal medium for everything around us. We like to talk about particles, because they are "free" -- they are flying freely in the vacuum, rarely interacting with each other.
Now instead of vacuum we consider another "not so universal" medium -- a glass. Like everything else the glass is made of the mentioned fundamental particles. It turns out that one wouldn't want to talk about the fundamental photon inside a glass -- it always interacting with stuff in the matter: it scatters, got absorbed, got re-emitted e.t.c. In other words it is not "free". It is much easier to consider a quasiparticle, which is "nearly a photon". A quasiparticle is an excitation of the glassy medium. And it behaves like it is "free" in the glass -- it is flying freely in the glass, rarely interacting with other quasiparticles.
From that point of view the answer to the question is "yes" -- inside the glass the quasiparticle called "photon" has some mass, while in the vacuum the fundamental particle called "photon" hasn't.
This second point of view is much more elaborate and takes more effort to understand, but I think that it is more "flexible" and allows you to understand such things as renormalization, effective field theories, quarks and hadron structure and QCD, thermal field theory, e.t.c.
After all, the thing we now call "the fundamental vacuum" can be just "a glass" made of something more fundamental.