X Ray tubes are widely used to produce X Rays.
They consist of a negatively charged cathode from which electrons are emitted, and a positively charged cathode, often made of a relatively hard metal like tungsten. The potential difference between anode and cathode is anything up to 200kV. Electrons are accelerated from the cathode to the anode, acquiring kinetic energy of up to 200keV, and hit the anode. When the electrons hit the anode, they are rapidly decelerated and lose some of their kinetic energy in the form of X Ray photons. The X Rays emerge in all directions. A window in the casing of the X Ray tube allows X Rays to emerge in a certain direction. The size of the window can be adjusted to control the width of the beam.
Only about 1% of the energy of the electrons that hit the anode is converted into X Rays. Most of the energy is lost to the anode as heat. The anode can be cooled using water or made in the form of a rotating disk: As parts of the disk rotate out of the path of the electrons they cool.
To make an X ray image, after passing through an object the rays may be detected using photographic film, or electronically.