Glare is horizontally polarised light reflected from surfaces such as water and roads. It can be largely eliminated using a polarised lens oriented so that only vertically polarised light can pass through.
Molecules of silver halide or similar UV reacting chemicals are embedded in the glass. When exposed to harmful UV rays these photochromic molecules change shape and block the UV rays; the lenses darken as the UV light intensifies. Away from UV light the molecules revert to their transparent shape.