We present a recently developed approach to calculate electron-hole excitat
ions and the optical spectra of condensed matter from first principles. The
key concept is to describe the excitations of the electronic system by the
corresponding one- and two-particle Green's function. The method combines
three computational techniques. First, the electronic ground state is treat
ed within density-functional theory. Second, the single particle spectrum o
f the electrons and holes is obtained within the GW approximation to the el
ectron self-energy operator. Finally, the electron-hole interaction is calc
ulated and a Bethe-Salpeter equation is solved, yielding the coupled electr
on-hole excitations. The resulting solutions allow the calculation of the e
ntire optical spectrum. This holds both for bound excitonic states below th
e band gap, as well as for the resonant spectrum above the band gap. We dis
cuss a number of technical developments needed for the application of the m
ethod to real systems. To illustrate the approach, we discuss the excitatio
ns and optical spectra of spatially isolated systems (atoms, molecules, and
semiconductor clusters) and of extended, periodic crystals (semiconductors
and insulators).