Photochromic sunglasses, also known as transition lenses, use photochromic molecules that change structure when exposed to ultraviolet (UV) light. These molecules darken in the presence of UV light (like sunlight) and become clear again when the UV light decreases, allowing the lenses to adjust their tint based on the lighting conditions.