A nanostructured heterojunction of CdS/Cd2x(CuIn)1-xS2 with x=0.2 was prepared by chemical spray pyrolysis on ITO/glass substrate at 350 °C. The X-ray diffraction pattern obtained from CdS/Cd2x(CuIn)1-xS2 solar cell confirmed the formation of Cd2x(CuIn)1-xS2 (CCIS), CuInS2, In2S3, and CdS phases, with crystallite size of 16 nm for CCIS and 26 nm for CdS films. The morphology of the film surface was obtained by AFM technique, which produced a greater grain size of 58.3 nm for CdS and 80 nm for CCIS surfaces. Optical absorbance analysis confirmed the composition-controlled electronic transition in the thin film, and the energy band gap was observed to red shift with the increase in the value of x. The electrical properties produced a P-type conductivity of CCIS with two activation energies. I–V characteristic in dark condition produced unsymmetrical heterojunctions, whereas abrupt-type heterojunctions were produced from the C–V curve. The solar energy conversion efficiencies achieved upon illumination of 100 mW/cm2 were 0.35%, 0.5%, 0.9%, and 1.28% for CCIS thicknesses of 610, 800, 910, and 1000 nm, respectively.