When a reverse bias photodiode is illuminated with light of energy greater than the forbidden energy gap (Eg) of the semiconductor, then electron hole pair are generated in the depletion region. Due to electric field of the junction, electrons are collected on the n-side and holes on p-side, giving rise to an emf.