Hwlau is correct about the book but the answer actually isn't that long so I think I can try to mention some basic points.
Path integral
One approach to quantum theory called path integral tells you that you have to sum probability amplitudes (I'll assume that you have at least some idea of what probability amplitude is; QED can't really be explained without this minimal level of knowledge)) over all possible paths that the particle can take.
Now for photons probability amplitude of a given path is $\exp(i K L)$ where $K$ is some constant and $L$ is a length of the path (note that this is very simplified picture but I don't want to get too technical so this is fine for now). The basic point is that you can imagine that amplitude as a unit vector in the complex plane. So when doing a path integral you are adding lots of short arrows (this terminology is of course due to Feynman). In general for any given trajectory I can find many shorter and longer paths so this will give us a nonconstructive interference (you will be adding lots of arrows that point in random directions). But there can exist some special paths which are either longest or shortest (in other words, extremal) and these will give you constructive interference. This is called Fermat's principle.
Fermat's principle
So much for the preparation and now to answer your question. We will proceed in two steps. First we will give classical answer using Fermat's principle and then we will need to address other issues that will arise.
Let's illustrate this first on a problem of light traveling between points $A$ and $B$ in free space. You can find lots of paths between them but if it won't be the shortest one it won't actually contribute to the path integral for the reasons given above. The only one that will is the shortest one so this recovers the fact that light travels in straight lines. The same answer can be recovered for reflection. For refraction you will have to take into account that the constant $K$ mentioned above depends on the index of refraction (at least classically; we will explain how it arises from microscopic principles later). But again you can arrive at Snell's law using just Fermat's principle.
QED
Now to address actual microscopic questions.
First, index of refraction arises because light travels slower in materials.
And what about reflection? Well, we are actually getting to the roots of the QED so it's about time we introduced interactions. Amazingly, there is actually only one interaction: electron absorbs photon. This interaction again gets a probability amplitude and you have to take this into account when computing the path integral. So let's see what we can say about a photon that goes from $A$ then hits a mirror and then goes to $B$.
We already know that the photon travels in straight lines both between $A$ and the mirror and between mirror and $B$. What can happen in between? Well, the complete picture is of course complicated: photon can get absorbed by an electron then it will be re-emitted (note that even if we are talking about the photon here, the emitted photon is actually distinct from the original one; but it doesn't matter that much) then it can travel for some time inside the material get absorbed by another electron, re-emitted again and finally fly back to $B$.
To make the picture simpler we will just consider the case that the material is a 100% real mirror (if it were e.g. glass you would actually get multiple reflections from all of the layers inside the material, most of which would destructively interfere and you'd be left with reflections from front and back surface of the glass; obviously, I would have to make this already long answer twice longer :-)). For mirrors there is only one major contribution and that is that the photon gets scattered (absorbed and re-emitted) directly on the surface layer of electrons of the mirror and then flies back.
Quiz question: and what about process that the photon flies to the mirror and then changes its mind and flies back to $B$ without interacting with any electrons; this is surely a possible trajectory we have to take into account. Is this an important contribution to the path integral or not?
I make f.lux, and I've chosen not to ship an overlay app for Android because I think it is a poor approach. It's hard to watch people say that these approaches are the "same" in any way, but I will try to bring numbers to the discussion, so maybe I will convince you.
Measuring "melanopic response per lux" answers the question: at the same visual brightness level, what's the impact to the melanopic action spectrum? Here's what you see on a Nexus 4 (an LCD panel):
- Nexus 4 (no filter): 0.93 m-lux/lux
- Nexus 4 (Twilight at 1500K): 0.83 m-lux/lux
- Nexus 4 (f.lux at 1900K): 0.31 m-lux/lux
Measuring color temperature on a white page:
- Nexus 4 (no filter): 7110K
- Nexus 4 (Twilight at 1500K): 5072K
- Nexus 4 (f.lux at 1900K): 2122K
For darker pixels, Twilight and other overlays make things brighter, not dimmer. So the more important thing is that overlays dramatically reduce contrast. Again, some measurements:
- Nexus 4 (native): 937.5:1
- f.lux 2700K: 425:1
- f.lux 1900K: 365:1
- Twilight 1500K (default): 70:1
- Twilight Bed Reading 1000K: 24:1
Our spectral data for these measurements uses a well-calibrated reference spectroradiometer and is Creative Commons licensed. You can see it here:
https://fluxometer.com/rainbow/#!id=Nexus%204%20Apps/6500k-nexus4
Finally (and I hope the numbers explain this), my opinion is that transparent overlays are mostly blue-light theater, and dimming a display is much much better when you can't do a real color transform. I do not want to make screens have lower contrast, because I think it makes them harder to read. Otherwise, I'd have shipped this!
Best Answer
It's important to distinguish different phases of the material. While it's true that water and snow consists of the same building blocks of $H_2 O$, those individual blocks are actually not as important as the resulting material. You can build a storage room and pyramids just out of bricks (at least in principle).
Gases
Let's start with the simplest case. Simplest in the sense that there is not much going on, just molecules flying around. Let us just assume ideal gas where molecules don't interact with each other. Then to explain everything it suffices to look at just one molecule.
The color of the molecule of course arises because of its absorption spectrum. This in turn depends on the molecule's energy levels. For atoms these are pretty nice discrete levels. For more complicated molecules you also have rotational and vibrational degrees of freedom to take into account and besides discrete levels you'll also see continuous strips that consist of very fine energy levels corresponding to that. For illustration, see the wikipedia article on $H_2$ hydrogen.
In any case, if you are somehow able to obtain that energy spectrum you can then investigate the macroscopic properties by the means of the usual Boltzmann statistics
$$\hat W = Z^{-1} \exp(-{\beta \hat H}) = Z^{-1} \sum_n\exp(- \beta E_n) {\hat P}_n $$
with $Z = {\rm Tr} \exp(-{\beta \hat H})$ being the partition function, $\beta$ the inverse temperature and $P_n$ projector on $n$-th energy level.
Using this you can see that as you increase temperature the energy level distribution will change to occupy higher levels and this in turn will change the probability of individual absorption processes between certain levels.
Now, the only place where you need to talk about QED is the connection between absorption spectrum and energy levels. Recall that in quantum mechanics energy levels are stable. They don't change, so there would be neither emission nor absorption. To resolve this apparent paradox we have to recall that we forgot to quantize the electromagnetic field. If you take this into account then atom's excited energy levels are no longer stable because of the fluctuations of electromagnetic field. Or in particle terms: because the number of particles is not conserved and it's easy to create photon out of nothing. Of course, energy is conserved so only photon's corresponding to the energy difference are possible. And the same can be said for absorption.
Liquids and solids
For now I won't talk about these phases because the answer is both becoming long and because optical properties of solids would constitute a book of its own. As for liquids, I have a feeling that the same analysis as for gases should hold except it's of course no longer sufficient to talk about individual molecules because of non-negligible interactions. But I guess starting from ideal gas's statistics and just switching temperature should give a reasonable first approximation.
Remark: Looking back on the answer, I didn't really explain your question completely. But I guess it's because it's quite hard to encompass everything that is going on. Maybe another split and specialization (e.g. to color of solids) of the question would be in order? :-)