Photoelectric cells work on the photoelectric effect where photons of light energy eject electrons from a material, creating electrical current. This is the principle behind solar cells and light sensors. The reverse process (electrical to light) occurs in LEDs.