A friend asked for a rundown on dichroics, which are the coatings we put on optical glass (and sunglasses) to optimize the transmission properties of our lenses. So, here is Dichroics 101. You could also check out Wikipedia.
Visible light is made of photons. Each one has a wavelength. Your eyes are receiving a bazillion photons every second in the daytime. At night, your dark-adapted eyes are capable of noticing the flicker of individual photons, but only sometimes. Visible light varies from 420 nm (blue) to 700 nm (red). A nm is a nanometer. 1000 nm is a micron (micrometer, but nobody but Europeans says that), 1000 microns is a mm (millimeter), 1000 mm is a meter.
So, a 420 nm photon is really small. However, atoms are 0.1 to 10 nm across, and we can lay down layers just a few dozen atoms thick, so we can actually build things that are smaller than the wavelength of light. Get back to that in a sec...
Any given transparent material has an index of refraction, which tells you (among other things) the speed of light in the stuff. Air has an index of refraction of about 1, so that the speed of light in air is the same as it is in a vacuum: 186,000 miles per second. Glass has an index of refraction of 1.5 to 1.8 (depending on which kind of glass). Plastics (like polycarbonate, what is most likely used in sunglasses) have an index of refraction around 1.5. So, in plastic, the speed of light is 186,000 miles/second / 1.5 = 124,000 miles/second.
Whenever photons go through a surface, like changing from air to glass or back, some will reflect. The number of photons reflected has to do with the change in index of refraction. The equation is: reflected fraction = (Na - Nb)^2 / (Na + Nb)^2, where Na and Nb are the indices of refraction for the two materials. For example, from air (Na = 1.0) to plastic (Nb = 1.5), the fraction is 0.04, or 4%. When you see yourself in a window (or in someone else's sunglasses), this is what you are looking at. Actually, you see two of these, one off the front surface, and one off the back surface of glass.
Suppose we put a 100 nm thick coating of Magnesium Fluoride (a.k.a. MgF2, index of refraction is 1.38) on a piece of glass (index of refraction 1.5). There will be two reflections: one from the air/MgF2 surface (2.5%), and one from the MgF2/glass surface (1.7%). Because there is a smaller change of index of refraction across each surface, each surface reflects less. If the index of refraction of MgF2 was closer to 1.25, halfway between air and glass, then we'd find that the power of the two reflections, when added, would be less than the power of a single reflection of an air/glass surface. But MgF2 doesn't have that nice property, so why do we bother?
Those photons act like waves: they have peaks and troughs. That 100 nm thickness wasn't just any old number, it is 1/4 of the wavelength of green light in MgF2. Green is ordinarily 550 nm, but going through MgF2 it's about 550/1.38=398.5 nm. The light reflected from the MgF2/glass surface will have travelled two times 100 nm more than the light reflected from the air/MgF2 surface, or one-half a wavelength more. So, the crests of the wave off the MgF2/glass surface will line up with the troughs of the wave off the air/MgF2 surface. When you add those two together, you get... cancellation.
Or... nearly cancellation. The air/MgF2 reflection is a little stronger than the MgF2/glass reflection, so there will be a little wave left over. A 550 nm photon will reflect (2.5-1.7=0.8%). There you have it, the first antireflection coating, as developed for German submarine periscopes in World War II.
Now notice that 420 nm (blue) light will not cancel as well, because the two reflections are 65% of a wavelength offset from one another. The peaks and troughs don't quite line up, so it doesn't cancel as well. The same is true of 650 nm (red) light. So, the reflected light will be purplish: it will have some blue and red, but not so much green.
This is the basis of dichroic filters. You can put several layers of stuff onto a glass or plastic surface, and each additional surface will have a reflection. At each wavelength, you can add up those reflections with their wave offsets to get an overall reflectivity. You end up with a graph which shows how much the thing reflects at each wavelength. By varying the materials deposited and the thicknesses, you can get something which has interesting and useful properties, such as reflecting all the IR (> 670 nm) and UV (< 390 nm).
You can buy such a thing at a good camera store. It's called a B+W 486 filter.