X-ray beams can be generated using x-ray tubes or synchrotron radiation sources. X-ray tubes produce x-rays by accelerating electrons towards a metal target, causing the emission of x-rays upon impact. Synchrotron radiation sources, on the other hand, generate x-rays by accelerating electrons to nearly the speed of light and forcing them to travel in a curved path using magnetic fields.