The output wavelengths of an electrodeless lamp are controlled by passing a fluid over the surface of the lamp to control its temperature. The stabilized temperature prevents thermal runaway of the lamp and stabilizes the output wavelengths of the lamp. When the fluid passing over the lamp is water, the lamp can be used for sanitary treatment of the water. The treatment can be enhanced by shaping the electrodeless lamp to provide maximally effective water treatment.