When photons strike a PV cell, they may be reflected or absorbed, or they may pass right through. Only the absorbed photons generate electricity. When this happens, the energy of the photon is transferred to an electron in an atom of the cell (which is actually a semiconductor).
With its newfound energy, the electron is able to escape from its normal position associated with that atom to become part of the current in an electrical circuit. By leaving this position, the electron causes a "hole" to form. Special electrical properties of the PV cell-a built-in electric field-provide the voltage needed to drive the current through an external load (such as a light bulb).