Why is gold used in the canopy of the F-22 Raptor?
In order to reduce the radar cross section (RCS) of the aircraft, the F22 canopies are coated with a thin layer of Indium Tin Oxide (ITO), which gives it a golden tint.
From the book F-22 Raptor by Bill Sweetman:
The F22 Raptor canopy ... comprises two sheets of polycarbonate, sandwiched between two layers of optical glass, fusion bonded in an autoclave and drape formed over a canopy blank ... A metallic coating of indium-tin-oxide is added to the canopy to reflect the radar waves, giving it a golden tint.
They are used in stealth aircraft to reduce the RCS. From globalsecurity.org:
A window member composed of a transparent resin or inorganic glass with a transparent conducting film such as gold or ITO (indium tin oxide) coated thereon, is used as an electromagnetic wave shield window for stealth aircraft. Applying such transparent conducting film enables, while maintaining transparency to visible radiation, both a radio wave stealth property which scatters radio waves in various directions so as not to be detected by radar, and an electromagnetic wave shield property which prevents harmful electromagnetic waves, except for visible radiation, from invasion into an aircraft.
This technique is used in other aircraft like the EA6B Prowler and the F-35.