X-rays are produced when electrons strike a metal target. The electrons are liberated from the heated filament and accelerated by a high voltage towards the metal target. The X-rays are produced when the electrons collide with the atoms and nuclei of the metal target.