Cathode: the heated filament acts as the cathode (negative) from which electrons are emitted
Anode: the anode (positive) is made of a heavy metal, usually tungsten.
An external power supply produces a voltage of up to 200 kV between the two electrodes. This accelerates the electrons across the gap between the cathode and the anode. The kinetic energy of an electron arriving at the anode is around 200 kV. When the electrons strike the anode at high speed, parts of their kinetic energy is transformed into X-ray photons that emerge in all directions.
Only a small fraction of kinetic energy of electrons are converted into x-rays. The rest of the energy is transfered to the anode as thermal energ