I know that sensors are made from several (million) photosites. But what is in the photosites? What chemicals, if any? How are they made?
What actually detects the light? I am looking for both CMOS and CCD photosites.
A photosite (photo/photon sensing site), as it is often termed around the web, refers to a sensor pixel in this context. Depending on the design of the sensor, a photosite or pixel may contain the necessary circuitry for a single colored pixel, or it may contain the necessary circuitry for multiple colors of pixels. When it comes to CMOS vs. CCD, they contain much of the same components, however CCD's offload some key circuitry off-die...namely the amplifier, and readout works differently with a CCD vs. a CMOS sensor.
Every sensor pixel is going to have some of the same basic components. The key element of a pixel is the photodiode. A photodiode is a semiconducting photodetector that utilizes the natural sensitivities of certain materials, such as Germanium and Silicon, to convert photons into electrons (charge). Silicon is normally used in consumer-grade imaging sensors, and it has a fixed sensitivity and penetration depth. As such, making a photodiode thicker does little to make it more sensitive, which is why pixels with larger surface area tend to be more sensitive than pixels with smaller surface area. In addition to the photodiode itself, each pixel will have column activate, row activate, and readout wiring. The exact nature of this wiring depends on the sensor design, and how they are used differs between CMOS and CCD sensor designs. Finally, in the case of CMOS sensors, additional circuitry is usually present. An amplifier is provided for each and every pixel, and in more advanced designs (notably Sony Exmor sensors) there will usually be one or more level of noise mitigation circuitry. Sony Exmor sensors are also the first to include on-die ADC (analog-to-digital conversion) circuitry, however this is per column, not per pixel, and is again aimed at reducing noise (with a happy side effect of also improving readout rate...at least theoretically.)
In a Bayer sensor design, each pixel is dedicated to sensing light of a single bandwidth, or color range. There are a variety of bayer Color Filter Arrays, however the most common is the RGBG quartet, where every 2x2 pixel square is composed of a Red and Green pixel on the top row, and a Green and Blue pixel on the bottom row. Each pixel will have a colored filter over the photodiode. This is essential, as silicon is sensitive to a very broad range of frequencies. It is particularly sensitive to infrared, requiring a dedicated sensor-sized IR cutoff filter to be mounted above the sensor to block all incoming IR. Silicon is most sensitive to red light, nearly as sensitive to green light, but its sensitivity to blue and violet light (as well as UV light) drops off considerably. Stronger color filters produce purer results for each pixel, but also have the tendency to absorb more light, reducing a sensor's overall quantum efficiency (Q.E.), and therefor affects signal-to-noise ratio (SNR). Weaker color filters produce less pure results for each pixel, but absorb less light and help improve Q.E. and SNR.
Bayer sensor designs strength lies in its ability to pack in the pixels, since each pixel is relatively simple (each one is basically a grayscale luminance sensor with a color filter over it). Unparalleled pixel densities have been achieved with bayer sensor designs, with the highest resolution consumer sensor currently being the Nikon/Sony design in the D3200. This 24.2mp sensor sports a pretty phenomenal 129 lp/mm raw (luminance) spatial resolution, and with the CFA accounted for pushes over 93 lp/mm in real-world spatial resolution. This is closely followed by Canon's ubiquitous 18mp sensor, which sports 116 lp/mm luminance spatial resolution, or about 84 lp/mm real-world.
There are at least two known layered sensor designs, where each photosite is capable of registering red, green, and blue light. The most notable of these is the Foveon X3 sensor. It was the first of its kind to hit the market in a consumer design, and it utilizes the natural wavelength filtering of silicon as light penetrates deeper to support achieve its goal: full color full resolution digital image sensing. The term "photosite" is more appropriate to use than "pixel" when discussing layered designs, as manufacturers tend to use the term pixel to mean individual color sensing elements, or sensels, and there are three stacked on top of each other at every photosite.
Canon has also filed patents for a layered CMOS sensor design, the most recent of which was within a year or two. They have yet to make use of it, and its design is currently more primitive than the Foveon design, however it shows promise.
A layered sensor design is more complex than a bayer design, possibly to a significant degree depending on explicit design decisions. Row/column activate requires more complex wiring, and that wiring usually needs to be layered itself. Each photosite in a layered design generally utilizes a single photodiode, which records luminance alone. Blue light is considered to be collected near the top of the photodiode, green is considered to be collected in the middle of the photodiode, and red is considered to be collected near the bottom of the photodiode. This is due to the fact that blue wavelengths do not penetrate very far into silicon before they are either converted to electrons or heat, green wavelengths penetrate farther, and red penetrates the farthest. Mechanisms I do not fully understand (I'm not a CMOS or silicon specialist) are used to read out the charge primarily at the top, middle, and bottom of the photodiode independently.
In a 15mp layered sensor design, there are a total of 45 million separate sensels to read out, so readout rate is generally not particularly fast. The distribution of light amongst the layers in a photosite also differs from bayer designs. Foveon sensors are well-known to have excellent blues compared to other sensor designs, thanks to the fact that the full surface area of the sensor is capable of sensing blue (vs. 25% in a bayer design), as well as the fact that the most exposed and sensitive part of a photodiode is used to collect blue light. Green and red are less sensitive, and need greater amplification or significantly greater surface area to register enough signal to be truly viable in a layered sensor design. As such, layered sensors are not pushing boundaries when it comes to image resolution...pixels need to be large for a layered design to work well and still be competitive vs. bayer designs.
Other non-functional structures may exist in a digital image sensor. One of the key factors in maximizing image quality is maximizing signal to noise ratio...particularly for the lowest luminance levels. Quantum efficiency is the ability of a sensing device to convert photons into electrons (or into charge), that can later be read out, amplified, and converted into digital bits. A sensor with 100% Q.E. would be capable of capturing every single photon and converting each one into an electron. This is technically impossible. Sensors that are capable of 80%-90% or more are generally classified as scientific grade, and have unparalleled sensitivity to go along with their unparalleled price. These sensors are often supercooled. Due to the presence of wiring to support column activate, row activate, reset, and other key functions of any electronic device, there are gaps between each pixel's light-sensitive area. Additional circuitry for noise reduction may also be present, and that too consumes space. Any photons that strike these non-sensitive areas are either converted to heat or reflected. Most consumer-grade DSLR sensors have a Q.E. in the range of 25-60%, with the more recent sensor designs from Sony exhibiting over 57% Q.E. (VERY high for a consumer-grade device).
There are a couple ways to combat the things that reduce Q.E. One way is to design a sensor that exposes nothing but light-sensitive surface, or as much light-sensitive surface as possible, and bury all wiring and noise reduction circuitry underneath. Such sensors are usually fabricated the same way, via EUV etching, on top of photosensitive material. The final sensors are then "flipped upside down", exposing the "backside" to light, rather than the "frontside". This is called a backilluminated design. These designs are more costly to manufacture, as circuitry has to be more carefully managed and packed into the available area...so its usually only used for very small sensors (i.e. for cellphone, P&S, and compact cameras).
Another way to combat photon loss is with microlenses. A microlens is a small lens above each photosite, with enough power to bend light that would otherwise strike non-sensitive parts of the sensor surface onto each photodiode. Canon sensor designs all use microlenses now, with the most recent offering gapless microlenses. The aim with gapless microlenses is to capture as many photons as possible without any striking non-sensitive surface area. In practice, microlenses are effective, but not 100% so. Sony has several patents for multi-layered microlens designs that would aim to improve their effectiveness (not sure if a multilayered microlens design is used in an actual consumer device yet or not.)
A combination of microlensing and backillumination in a single sensor design should have the effect of greatly improving Q.E. With the addition of advanced cooling, such as thermoelectric (peltier) cooling, CMOS sensor design could approach the levels of scientific grade devices. Given the fact that a peltier can be constructed purely out of appropriately-wired P- and N-type silicon, there is no reason a CMOS sensor couldn't be designed with a peltier built in, for the ultimate in high-tech, low-noise, high signal beauty.
What is actually going on?
To give you a less technical and more intuitive point of view, the photo-site is governed by the photo-electric/photo-voltaic effect which was actually one of Physics' greatest mysteries, until Albert Einstein explained and consequently won his Nobel prize for explaining what was actually going on.
It would not be incorrect to assume that a photo-site is a charged rod. When incident photons (think packets of light called quanta) hit the charged rod they excite the electrons in the rod (in the valence band), this excitation causes the electrons to become "free" and some of them leave the current rod and disperse (either in to another material or charged gases, this is called a Galvani potential). Once the electrons disperse, the potential in the rod is no longer the same.
Now, a lens focuses different intensities of light onto a sensor, causing a pattern of liberated electrons which in turn causes a pattern of different potentials for the rods (photosites). The voltages of each rod are recorded after exposure time and the pattern thus becomes an image.
But what about colour?
The method explained above is simple enough in that it explains how a monochromatic image is produced. To produce colour you have to think of patterns. By far the most popular way of producing a digital colour image is the Bayer Array (there are others, see Foveon and Layered Silicon Sensors).
The Bayer Array is simply a patterned grid of three different colours (red, green and blue), which sit over the sensor. Here is the Wikipedia page for Bayer Array. Each individual filter gives the corresponding photosite underneath it a colour, but if you look carefully you'll notice that there appear more Green filters in the array than Red or Blue. In fact the array consists of 50% Green, 25% Blue, 25% Red. Why is this? It corresponds to the fact that the human eye generally sees 50-60% Green, 25-30% Red, 10-15% Blue. This means that after an image is captured, you essentially have three different images: red, blue and green. These are what you see if you inspect the channels of an image in Photoshop. These images actually have less resolution than the total image but the sensor processor in the camera interpolates these images to full resolution.