Do hot spots in the CMB anisotropy map actually correspond to denser or less dense regions? When looking at the map of the anisotropies of the CMB, do slightly hotter (red) spots correspond to denser or less dense regions at the time of decoupling? I am getting confused, because I have read arguments in both directions: 


*

*In some places it is said that photons coming from denser regions are more energetic, simply because these regions were hotter (due to the compression of the gas). Thus, according to this view, hotter spots would correspond to denser regions

*However, other pages say that photons coming from denser regions lost more energy to escape from these regions (because the gravitational attraction from overdense regions was larger) and thus are cooler than the average. Then, from this perspective hotter spots would correspond to less dense regions.        
Which of the above views is correct?

UPDATE: I have continue reading a bit about this topic. I understand now that the behavior is different for small scales (those who subtend less than about 1 degree in the sky, for which hot spots correspond to denser regions) and large scales (for which, paradoxically the opposite is true). 
Now, I am not sure if the following holds: The above CMB anisotropy map comprises the contributions of all different scales (up to the maximum angular resolution of Planck) so we cannot establish a direct correspondence between hot/cold spots and dense/rarefied regions. Is that true?
 A: It is possible to relate density perturbations on a given length scale with the temperature anisotropy on a given angular scale on the last scattering surface.
The dense/rarified regions arise from acoustic oscillations in the plasma.  To understand how one of these acoustic oscillations appears on the last scattering surface of the CMB, use the following plane wave expansion:
$$e^{i{\bf k}\cdot{\bf r}} = 4\pi \sum_{\ell = 0}^\infty \sum_{m=-\ell}^\ell i^\ell j_\ell (kr) Y_{\ell m}(\hat{\bf r}) Y^*_{\ell m}(\hat{\bf k}),$$
where $\hat{\bf k}$ is the wave vector, $\hat{\bf r}$ points from Earth to a location on the last scattering sphere, and the $j_\ell$'s are spherical Bessel functions.  This shows that a single plane wave gives rise to a series of angular fluctuations—not just one—with the spherical Bessel functions controlling how much the plane wave contributes on each angular scale $\vartheta \approx \pi/\ell$.
As an easy example, consider a 3-dimensional plane wave propagating in the $\hat{\bf z}$-direction with a wavelength $\lambda = 2d_{\rm ls}/3$, where $d_{\rm ls}$ is the diameter of the last scattering surface.  A two-dimensional version of this situation looks like this:

In this case, $m=0$ and the above equation simplifies considerably,
$$
e^{i{\bf k}\cdot{\bf r}} = 4\pi \sum_{\ell = 0}^\infty \sqrt{\frac{2\ell +1}{4\pi}}j_\ell(kr) Y_{\ell 0}(\hat{\bf r}),
$$
with only the zonal spherical harmonics appearing in the sum. Working out the first few terms of the series we see that a plane wave with $\lambda = 2d_{\rm ls}/3$ contributes most strongly to anisotropies on the last scattering surface through multipoles $\ell = 7$ and $\ell = 8$.  Here's an illustration of how the plane wave contributes to the anisotropy on various scales:

Conversely, the multipole $\ell = 7$ receives its greatest contribution from the plane wave with $\lambda = 2d_{\rm ls}/3$, where $j_7(kr)$ has its global maximum. The spherical Bessel functions are decaying oscillating functions, with subsequent local maxima corresponding to the diminishing contributions from fluctuations with ever smaller wavelengths,

In general, for a fluctuation with wavenumber, $k$, the rule-of-thumb is that it contributes most to the multipole for which $kr \approx \ell$ (and, conversely, that this multipole receives its greatest contribution from this mode), and therefore, a fluctuation of wavelength $\lambda$ contributes most strongly to anisotropies on the last scattering surface with an angle $2\vartheta \approx \lambda/d_{\rm ls}$.
A: The link has a nice description. Let me quote a portion

The spots on the map correspond to photon energies at the time of the last scattering of photons by electrons. The areas of higher energy are blue, while the areas of low energy are red. If this is a little confusing, try to imagine the colors in a campfire. The hottest and most energetic part of the fire is the blue flame, while the red flame is the coldest and least energetic part of the fire. The same thing applies to this map of the CMB temperature anisotropies. The blue spots are hotter regions of more energy, and the red spots are colder regions of less energy. The strange thing is, the cold spots (ie. red spots) are the more dense regions. Why, you ask? Well, these cold regions are what we call gravitational potential wells, so the photons are "pulled" in these regions by gravity, making them more dense. Originally, these regions would be hotter then the less dense regions because when you compress a gas for example, the temperature increases as more particles collide with each other. However, it requires a lot of energy for the photons to overcome the gravitational pull and exit these potential wells, so these areas actually end up having less energy and are colder than the less dense regions.

However, the comment by @anna-v is quite accurate, there are more than one mechanism behing the CMB anisotropies and is a part of active field of research today. 
