Here's a breakdown:
* 1800: Sir William Herschel discovered infrared radiation beyond the red end of the visible spectrum using a prism and a thermometer.
* 1801: Ritter, inspired by Herschel's work, investigated the opposite end of the spectrum. He observed that silver chloride, a chemical sensitive to light, darkened faster when placed beyond the violet end of the visible spectrum. He concluded that there must be invisible rays beyond violet, which he named "chemical rays."
* Later: These "chemical rays" were later named ultraviolet rays because they were located beyond the violet end of the visible spectrum.
So, while Herschel's work inspired Ritter, it was Ritter who actually discovered and named ultraviolet radiation.