Step 1: Understanding the Concept:
The electromagnetic spectrum covers many types of waves, each with its own use.
Water purification means killing germs such as bacteria and viruses in drinking water.
Step 2: Key Formula or Approach:
Short wavelength radiation with high photon energy can damage the DNA of microbes.
Ultraviolet (UV) light, with wavelength about 10 nm to 400 nm, does this job. Water purifiers use UV lamps for this reason.
Step 3: Detailed Explanation:
Check each option against this use.
X-rays have much higher energy. They are used in medical imaging and in studying crystal structure, not in water treatment.
Infrared rays are heat waves. They are used in remote controls, night vision and heating.
Ultrasonic waves are sound waves of high frequency. They are not electromagnetic waves at all, so the word "rays" in this option is wrong.
Ultraviolet rays are the right choice, because they kill harmful germs in water.
Final Answer:
Ultraviolet rays purify water, which is option (B).
\[ \boxed{\text{Ultraviolet rays}} \]