In the present work we write a general expression for the local densit
y of states (LDOS) due to a commen-surate charge density wave (CDW). T
he main goal is to investigate the voltage dependence of the contrast
in the scanning tunneling microscope (STM) images of materials showing
CDW's. For layered materials, having nearly two-dimensional electroni
c structures, the problem is complicated by the many-band situation ne
ar the Fermi level, and by the incomplete band gapping. Nevertheless,
a simple perturbation method allows one to relate the amplitude and ph
ase of the CDW to features of the band structure. We emphasize the rol
e of particular characteristic energies, at which the CDW has a large
contribution from special k points of the surface Brillouin zone, lead
ing to different modulations in the STM image. In a second part of the
paper, we consider the voltage-dependent contrast of NbSe2. For this
material, we find that the amplitude and the phase of the CDW change s
ignificantly as a function of energy (or voltage), resulting in a numb
er of different possible motifs. For example, the direct comparison be
tween occupied and empty states reveals that new states on the order o
f E-F+/-Delta, giving a dominant contribution to the LDOS, have differ
ent phases. As a result, in the corresponding STM images, the maxima o
f the corrugation have shifted positions along the diagonal of the con
ventional unit cell.