Also known as light-dependent resistors (LDRs), these little devices sense light and change their resistance accordingly. They’re used in all kinds of circuits from street lights to light meters. Under ambient light, their value ranges between 5–10KΩ, whereas in darkness, they go up to ~200KΩ.
Typically, we wire these devices in a voltage divider, and detect changes in voltage (consequence of the changes in resistance) using a microcontroller's analog pin. This allows us to use light to trigger an event like stopping a motor, or controlling the pitch of a note by waving something in front of the photocell to block the light. Using a few of them simultaneously, we can even make a basic, line-following robot!
Please note that these types of sensors are intended for measuring basic light changes, and are not dependable for detecting precise fluctuations!