In X-ray tubes, the light is generated by electrons accelerated to energies in the range of some keV to several hundred keV towards a metal anode. Hitting the anode and thereby being slowed down, part of their energy is dissipated in X-radiation.
These websites give an interesting introduction:
Antique X-ray Tubes and Accessories
Health Physics: Historical Instrumentation Collection