Materials for use in a solar cell In a solar cell, photons of the incident sunlight supply energy for excitation of electrons - a process which generates electron-hole pairs which can move under the influence of the electric field of the depletion region and give rise to current. For excitation of electrons to occur, the incident photons must have energy equal to or more than the band gap of the material used. 
The solar radiation spectrum received by the earth has maximum intensity at wavelength nearly corresponding to photons of energy 1.5 eV. Materials like silicon (with band gap 1.1 eV) are thus suitable for use in solar cells, since their electrons can be excited by photons of energy 1.5 eV. However, there are also a number of other materials like PbS (where band gap is 0.4 eV) which have band gaps less than 1.5 eV - but are not as frequently used in solar cells as Si, or GaAs, are. My book addresses this question, and answers it by saying that in solar cells made of PbS, where incident photons' energy is a lot higher than the band gap, most of the photons incident are absorbed by the top layer of the cell and do not reach the junction (electron-hole separation, of course, needs to occur in the depletion region). I do not quite understand the rationale behind this answer, however. Why are photons of very high energy majorly absorbed at only the surface of the diode?
A possible reason (that I could think of) why PbS is not used could be that ionisation of the electron occurs instead - since the photon energy far exceeds the band gap, perhaps it is enough to excite the electron out of the crystal rather than just exciting it to the conduction level. Ionised electrons are lost by the diode and cannot possibly contribute to the circuit current. 
 A: When light is absorbed in a semiconductor, the excited electrons will quickly relax to the conduction band edge. The extra energy of the absorbed photon compared to the bandgap of the semiconductor is lost to heat. Materials with 0.4 eV bandgap like PbS are not used in solar cells because most of the solar spectrum is made of photons with greater than 0.4 eV energy, and therefore there is a lot of thermal energy loss upon absorption of those photons. You don't want too high of a bandgap either because then you won't absorb part of the solar spectrum. One can in fact calculate the optimum bandgap for the solar spectrum and obtain around 1.4 eV, giving a maximum power conversion efficiency of ~33% known as the Schockley-Queisser limit. Note that the maximum possible efficiency for a material with bandgap ~0.4 eV is only 10%. 
The short penetration depth of high energy light basically arises from the fact that the density of states grows away from the band edge. For example, In a simple parabolic band model the density of states goes as $\sqrt{E-E_g}$. More states means more absorption and a shorter penetration depth. This fact also affects the design of Silicon solar cells, check out the last demonstration on this page.
A: That's a CBSE class $12$ question from NCERT book, Semiconductors, yeah?
I am a class $12$ student right now, so let me answer it! I will explain it fully.

$\mathrm{Si:}$ is the preferred medium for solar cells because its $\mathrm{E_g}$ value is $1.1 \ eV$, which is near the solar radiation maximum intensity where photon energy =  $1.5 \ eV$. Photons with $\mathrm{h\nu > 1.1  \ eV}$ can produce carriers at the junction (depletion layer); therefore, photons with $\mathrm{h\nu = 1.5  \ eV}$ can produce carriers. As their intensity is higher, they will produce more carriers in the semiconductor. Hence, we have a larger number of carriers (electrons and holes) formed, which we want because we desire to produce the most possible power. $\mathrm{Si}$ is commonly used in solar cells.
$\mathrm{GaAs:}$ has an $\mathrm{E_g}$ = $1.53 \ eV$, which is not too much higher than the energy of the highest intensity of solar radiation photons ($1.5 \ eV \approx 1.53 \ eV$). Hence, the intensity (of $1.53 \ eV$ energy photons in solar radiation) is higher too, and so the higher carrier number. One more reason is that the "Absorption coefficient" is higher for $\mathrm{GaAs}$. The higher it is, the more the capability of the substance to absorb the light power - more absorption leads to the production of more carriers.
$\mathrm{CdS \ or \  CdSe:}$ For them, $\mathrm{E_g \approx 2.4 \ eV}$. Photons of this energy in the solar radiation spectrum are of low intensity. And the photons carrying energy more than $\mathrm{E_g}$ are even less intense. So, the carrier production is not very high as the number of available photons for carrier production is small in the solar radiation for $\mathrm{CdS \ or \  CdSe}$.
$\mathrm{PbS:}$ has an $\mathrm{E_g = 0.4 \ eV}$, which is much less than the energy of the highest intensity photons in the solar radiation. So, there are a number of photons available (having $\mathrm{h\nu > 0.4 \ eV}$) that can work for carrier production. But, the density of $\mathrm{PbS}$ is very high as compared to $\mathrm{Si}$ and $\mathrm{GaAs}$.
Densities:

$\mathrm{GaAs = 5.3176 \  g/cm^3}$
$\mathrm{Si \ \approx \ 2.3290 \  g/cm^3}$
$\mathrm{PbS = 7.60 \ g/cm^3}$

As you can see, $\mathrm{PbS}$ has the highest density of these. So when solar energy falls on it, almost any intensity of solar energy produces carriers. But this happens at the top layer of the semiconductor due to its high density. Most of the solar radiation can't reach the depletion region, which is where electron-hole pairs generated can be swept without recombination. Remember, there's no electric field present at the top, so the pairs may recombine.
So, that's it. Now start the Transistor!
