This is how a solar cell works. The silicon wafer has an electron rich (n) layer and an electron poor (p or hole) layer. A photon of light energy is absorbed by the silicon semiconductor and if it has sufficient energy it forms an electron/hole pair or exciton. Under the right conditions the charges are separated and the free electron flows through the circuit creating an potential. Meanwhile another electron flows from the circuit back into the hole layer where it recombines with the original hole that was created.