X-rays are produced when high-velocity electrons collide with a metal target in an X-ray tube. X-rays have short wavelengths and can penetrate materials, existing as either soft or hard X-rays depending on their energy level. They are used in medical imaging and diagnostics to detect broken bones or other internal issues but also present certain radiation hazards if not used safely. Precautions like protective lead coats and dosimeters are necessary when working with X-ray equipment.