Compact fluorescent lamps (CFLs) use mercury vapor within a glass tube. When electricity passes through, it excites the mercury vapor, producing ultraviolet (UV) light, which then excites a fluorescent coating on the inside of the tube, causing it to emit visible light. Mercury is a toxic heavy metal that poses environmental and health risks if released, necessitating safe disposal practices for CFLs.