The places photon absorption happened are different for various types of solar cells.Generally, the absorption process would happen as long as the incident photon's energy larger than the bandgap of the used materials.
However, for example, with regard to PN junction soalr cells, we would like the absorption process happened near the junction, because only in there can the excition be seperated into electron and hole pair under the force of electric field, and then flowed into N-type area or P-type area, respectively. And finally be collected by each electrode.
As to a schottky junction or heterojunction and homojunction solar cell, the photon absorption mainly happens around the junction region if the bandgap of the semiconductor is larger than the energy of the light. But usually, the optimal bandgap of the materials in solar cells is about 1.4eV under STC. Obviously the photon absorption process must under way more or less in the semiconductor materials.
For common thin film solar cells, like GaAs-, CdTe-, CZTSe- and CIGS-thin film solar cells, the absorption often conduct in the active layer, generally the active semiconductor.
Other type cells like DSSC or QDSSC, the absorption process also happens everywhere especially near the dye or Quantum Dots. And to recently the hottest perovskite solar cells, the photon absorption happens within the whole perovskite materials.
There is a confusion. Photo absorption is "preferable" to be near the p-n junction, but actually, it occurs everywhere. The most important basic is that the structure does not affect the photo absorbance; photo absorption occurs as long as the photon energy is higher than the band gap. What happens in the photo exited carriers...it is another matter.
The amount of absorbed vs transmitted light is defined by the absorption coefficient. The latter is dependent on material and wavelength or energy of photons. For the same semiconductor absorption coefficient is usually independent of doping (n or p)
For photons with energies below semiconductor bandgap absorption coefficient is very small, and the semiconductor is nearly transparent to this light.
Absorption profile is exponential, I.e. the amount of transmitted light drops exponentially with depth I(x)=I(0) exp(- a x), where a is the absorption coefficient. From this point of view, absorption takes place throughout the solar cell. This also means that most of the light is absorbed within several 1/a independently of doping.
Thanku for all your responses, however i do have some more confusion.
If the photon absorption takes place throughout the cell (p-n homojunction), then why do we obtain effective EHP carriers only from the absorber layer(mostly p-type). I have read that n-type layer does not contribute much as the carrier lifetime is assumed to very small this side of the junction (obviously EHP generation occurs but carriers recombine again). Why is it so ?
In your assuming structure, the n-type layer is very thin, right? That means the number of the photo generated carriers is relatively very small. I say it occurs everywhere, it means the number of photo generated carriers are almost proportional to the thickness of the layer. (I say "almost". See Andrei's explanation for exact solution.)
As you mention, carrier recombinations occur some places, and they are sources of the loss. The surface of the cell is one of the most significant place.
The absorption wavelength or photon energy is basicly determined by the energy gap. In addition, the light's penetration depth also affects the absorption. For indtance, short length light could not reach a deep area in the material, in such case, absortion mainly occurs within the surface.