Question about electron-hole pair generation in depletion layer for a p-n junction photodiode At the heart of operation of p-n (or p-i-n) junction photodiodes is the absorption of photons leading to generation of electron-hole pairs. If the diode is, e.g., reverse biased, then the motion of these electron-hole pairs due to the electric field constitutes a reverse current in the external circuit. The electric field is essential for the transport of these charged carriers in a specific direction. 
A p-n junction can support an electric field only in the depletion layer, so only electron and holes generated in this region or its vicinity can contribute to the current. 
However, the depletion layer is also the region which contains mainly fixed charges -- positive ions on the n side and negative ions on the p side. 
I am confused because this should then imply that the mobile charged carriers are actually generated from these positive or negative ions, whereas, the-normally-used-statements, such as "an electron in the valence band is excited to the conduction band leaving a hole behind...", seem to apply to the doped atoms. 
It is also not easy to imagine the negative/positive ions giving electrons/holes due to the impinging photons. 
Can anyone elucidate upon this confusion?
As such, the same question also applies in the case of impact ionization for avalanche diodes, where highly energetic electrons/holes create electron-hole pairs due to collisions, and this process must also take within the depletion layer. 
[1]: Fundamentals of photonics by Saleh and Teich, http://www.amazon.com/Fundamentals-Photonics-Bahaa-E-Saleh/dp/0471358320 
 A: Maybe I know the origin of your question. I had the same doubt.
Depletion layer is said to be free of carriers upon established and equilibrium reached. This approach is widely used in text books to solve the depletion layer zone in pn junctions. However, the depletion layer is still able to produce new electron-hole pairs if depletion layer is excited with higher than band gap energy photons. 
On other words, electrons from n-dopings centers in the n doped material were removed from this depletion layer side. But this depletion layer still contains intrinsic material able to absorb photons promoting electrons to conduction band and holes to valence band.
In fact, photovoltaic devices are fabricated looking to maximize this depletion layer width. A trick is to assemble  p-i-n junctions where the intrinsic part is added to extend the depletion layer further. Inside depletion layer, drift transport has a relevant role (diffusion is unavoidable always anywhere). Probably, in photovoltaics using indirect band gap light absorbers, it is good to extend the depletion layer because it favours that carriers reach the frontier electrodes. However, I think that new light harvesters with direct band gap (like hybrid perovskite) generating almost free electron/holes (no excitons or weakly bounded excitons), the role of the depletion layer is no so relevant and it is prefered good transport properties. 
A: Here's a way to think of it:
In electric equilibrium, the doping atoms, such as boron or arsenic, have an extra electron or hole, but it's not doing anything. When a photon comes in, it brings up the quantum energy level of the extra charge carrier, and the electron or hole moves to the conduction zone. Because it is in the presence of an electromagnetic field -- the depletion zone -- it is whisked away and current flows. Hope this helps.
A: A negative charged ion like Boron is towards P end of Junction.
When it gains a photon , electron from $B^-$ is excited from valence band to conduction band.
This creates a hole at lattice point where electron was formerly present.
Free electron moves towards N doped side which is positively charged.
http://www.electronics-tutorials.ws/diode/diode4a.gif?81223b
