Ultraviolet (UV) rays are used to purify water because they have germicidal properties. UV rays can kill or deactivate harmful microorganisms by damaging their DNA, which makes them an effective method for water purification.
Infrared rays are primarily used for heating purposes.
X-rays and Gamma rays are used for medical imaging and cancer treatment but are not commonly used for water purification.
Thus, the correct answer is Ultraviolet rays.
\bigskip