The first attempts at measuring the optical properties of X-rays such as refraction, reflection and diffraction are described. The main ideas forming the basis of Ewald‘s thesis in 1912 are then summarized. The first extension of Ewald‘s thesis to the X-ray case is the introduction of the reciprocal lattice. In the next step, the principles of the three versions of the dynamical theory of diffraction, by Darwin, Ewald and Laue, are given. It is shown how the comparison of the dynamical and geoämetrical theories of diffraction led Darwin to propose his extinction theory. The main optical properties of X-ray wavefields at the Bragg incidence are then reviewed: Pendellösung , shift of the Bragg peak, fine structure of Kossel lines, standing waves, anomalous absorption, paths of wavefields inside the crystal, Borrmann fan and double refraction. Lastly, some of the modern applications of the dynamical theory are briefly outlined: X-ray topography, location of adsorbed atoms at crystal surfaces, optical devices for synchrotron radiation and X-ray interferometry.