Solar cell is a device which converts light energy into electrical energy . When light is allowed to fall on this cell , the cell generates a voltage across its terminals . the voltage increases with increase in light intensity . It consists of a PN junction diode with a glass window on top surface layer of P material is made thin so that incident light photons may reach PN junction . When these photons collide with valence electrons . They comport them sufficient energy as to leave their parent atoms . The electrons and holes are generated on both sides of the junction .
In the diagram given in the link below it is an ordinary diode . It consist of silicon , Ge , with window of p-type and Si and Ge are most commonly used semiconductors .