How are classical optics phenomena explained in QED (Snell's law)?
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?
It really desires a long discussion. You may be interested in the book "QED: The Strange theory of light and matter" written by Richard Feynman (or the corresponding video), which gives a comprehensive introduction with almost no number and formula.
For the solution of Schrödinger equation of hydrogen atom. The energy level is discrete, so its absorption spectrum is also discrete. In this case, only few colors can be seen. However, in solid, the atom are interacting strongly with each other and the resulting absorption spectrum can be very complicated. This interaction depends strongly with its structure and the outside electrons. The temperature can play an essential role for the structural change and a phase transition can occur and so does color change. I think there is no easy explanation for the exact absorption spectrum, or color, for a material without doing complicated calculation.
We start with the background 4-metric $$ \mathbb{g} ~=~ -\frac{c^2}{n({\bf r})}\mathrm{d}t\odot\mathrm{d}t +n({\bf r}) \sum_{i,j=1}^3\eta_{ij}\mathrm{d}r^i\odot\mathrm{d}r^j. \tag{1}$$ Here $n({\bf r})$ is an effective refractive index, since for a massless point particle, the coordinate 3-speed is $$ \frac{ds}{dt} ~:=~\left|\frac{d{\bf r}}{dt}\right| ~:=~\sqrt{\sum_{i,j=1}^3\eta_{ij}\frac{dr^i}{dt}\frac{dr^j}{dt}} ~=~\frac{c}{n({\bf r})}. \tag{2} $$ An important case is the weak-field solution to the linearized EFE, where the effective refractive index
$$ n({\bf r})~=~1-\frac{2\phi({\bf r})}{c^2} \tag{3}$$ is related to the specific gravitational potential $\phi({\bf r})$.The EM gauge field $A_{\mu}$ satisfies Maxwell's equations in the background spacetime (1). Here the refractive index $n=\sqrt{\varepsilon_r\mu_r}$ where $\varepsilon_r$ is the background material's relative permittivity, and $\mu_r$ is its relative permeability.
The stationary action principle for a corresponding massless point particle (such as the photon with $m=0$) is given in e.g. this Phys.SE post. Here we cannot resist the temptation to write down a stationary action principle that works for both a massless and massive point particle $$ \begin{align}S[t,{\bf r}] ~=~& \int \! \mathrm{d}\lambda~L , \qquad L~=~\frac{1}{2e}\left(-\frac{(c\dot{t})^2}{n}+ n\dot{\bf r}^2 \right)-\frac{e(mc)^2}{2}, \cr \dot{\bf r}^2~:=~&\sum_{i,j=1}^3\eta_{ij}\dot{r}^i\dot{r}^j, \qquad \dot{r}^i~:=~\frac{dr^i}{d\lambda}, \cr [e] ~=~&\text{Mass}^{-1}, \qquad [\lambda]~=~\text{Time},\end{align}\tag{4}$$ where $e>0$ is a Worldline (WL) einbein field, and $\lambda$ is a WL parameter.
The 3-momentum is $$ p_i~:=~\frac{\partial L}{\partial\dot{r}^i}~\stackrel{(3)}{=}~\frac{n}{e}\dot{r}_i. \tag{5}$$ Since the time coordinate $t$ is a cyclic variable, the corresponding momentum $$ -E~\equiv~p_t~:=~\frac{\partial L}{\partial\dot{t}}~\stackrel{(3)}{=}~-\frac{c^2}{e n}\dot{t}, \qquad [E] ~=~\text{Energy}, \tag{6}$$ is a COM.
The corresponding Hamiltonian is $$ H~\stackrel{(4)+(5)+(6)}{=}~\frac{e}{2}\left(-\frac{nE^2}{c^2}+ \frac{{\bf p}^2}{n} +(mc)^2\right). \tag{7}$$ In the Hamiltonian formulation, the einbein field $e$ has become a Lagrange multiplier that imposes the mass-shell/eikonal equation$^1$
$$ \frac{nE^2}{c^2}~\stackrel{(7)}{\approx}~ \frac{{\bf p}^2}{n} +(mc)^2 .\tag{8} $$Let us consider the corresponding Routhian where we only Legendre transform the cyclic variables, cf. e.g. this Phys.SE post. Since the Routhian does not depend on the cyclic variables, and their corresponding momenta are COM, we can demote these dynamical variable to external parameters. The Lagrangian for the remaining dynamical variables is given by minus Routhian $$ -R~\stackrel{(4)+(6)}{=}~\frac{n}{2e}\dot{\bf r}^2+\frac{e}{2}\left(n\frac{E^2}{c^2}-(mc)^2\right) . \tag{9}$$ The EL equation for the einbein field $e$ becomes $$ e ~\stackrel{(9)}{\approx}~\frac{\dot{s}}{\sqrt{\frac{E^2}{c^2}-\frac{(mc)^2}{n}}}, \qquad \dot{s}~:=~|\dot{\bf r}|~=~\sqrt{\dot{\bf r}^2}. \tag{10}$$ Therefore minus Routhian becomes $$ -R~\stackrel{(9)+(10)}{\approx}~n \dot{s} \sqrt{\frac{E^2}{c^2}-\frac{(mc)^2}{n}} , \tag{11}$$ So in the massless case $m=0$ the $\lambda$-integral of minus Routhian (11) is proportional to the optical path length $$\int \! \mathrm{d}s~n ~=~ \int \! \mathrm{d}\lambda~n \dot{s}. \tag{12}$$
The action (11) is WL reparamatrization invariant, which means that the corresponding energy vanishes, and its stationary and abbreviated actions coincide. The abbreviated action (12) is precisely Fermat's principle. The action principle for the $\lambda$-integral of minus Routhian (11) is a generalized Fermat's principle for both massive and massless point particles!
The EL equation $$ \begin{align}\frac{\frac{E^2}{c^2}-\frac{(mc)^2}{2n}}{\sqrt{\frac{E^2}{c^2}-\frac{(mc)^2}{n}}}\frac{\partial n}{\partial r^i} ~&\stackrel{(11)}{\approx}~ \frac{1}{\dot{s}}\frac{d}{d\lambda}\left(n\sqrt{\frac{E^2}{c^2}-\frac{(mc)^2}{n}}\frac{\dot{r}_i}{\dot{s}} \right) \cr &~=~\frac{d}{ds}\left(n\sqrt{\frac{E^2}{c^2}-\frac{(mc)^2}{n}}\frac{dr_i}{ds} \right)\end{align} \tag{13} $$ for minus Routhian (11) becomes the ray equation $$ \frac{\partial n}{\partial r^i}~\stackrel{(12)}{\approx}~\frac{1}{\dot{s}}\frac{d}{d\lambda}\left(n\frac{\dot{r}_i}{\dot{s}} \right) ~=~\frac{d}{ds}\left(n\frac{dr_i}{ds} \right)\tag{14}$$ in the massless case $m=0$.
--
$^1$ The $\approx$ symbol means an on-shell equality, i.e. equality modulo EOM.