n-CdS builds with p-CdTe a thin film heterojunction solar cells which is characterized by high conversion efficiency. Such solar cells are commercialized. The basic idea behind the heterojunction solar cell is that they be best formed by n-type wide gap window over p-type narrow band absorber substrate. This is valid with CdS which is a wide gap window material over CdTe with an optimum absorber band gap of 1.35 eV.
The other factor is the interatomic matching between the two materials to suppress the interface recombination. Article Recent progress on CdTe/CdS thin film solar cells
the optimum structure for a solar cell is pn+ junction where p ia absorber nad n+ is widebandgap layer which pass almost all light to the absorber light. CdS has high electron density and have suitably high bandgap 2.4eV apart from that is form decent interface owing to conductionband matching (or nearly matching) with most p type layer like CZTS/CIGS/CdTe