X-rays are electromagnetic radiation of wavelengths shorter than visible light. They have typical wavelengths ranging from 0.01 to 10 nanometers. X-rays are produced when high-speed electrons collide with a metal target in an X-ray tube. There are two main production methods - bremsstrahlung and characteristic line emission. Bremsstrahlung produces a continuous X-ray spectrum, while characteristic lines produce peaks at specific wavelengths. X-ray diffraction is used to determine crystal structures by analyzing the diffraction pattern produced when X-rays interact with a crystalline material. Bragg's law describes the angles at which diffraction occurs based on the wavelength and crystal plane spacing.