A simple chemical precipitation route was utilized for the synthesis of ZnO nanoparticles (NPs), CdS NPs and ZnO–CdS nanocomposites (NCs). The synthesized nanostructures were examined for the crystal structure, morphology, optical properties and photodegradation activity of rhodamine B (RhB) dye. The ZnO–CdS NCs showed a mixed phase of hexagonal wurtzite structure for both ZnO NPs and CdS NPs. Pure ZnO NPs and CdS NPs possessed bandgaps of 3.2617 and 2.5261 eV, respectively. On the other hand, the composite nanostructures displayed a more narrow bandgap of 2.9796 eV than pure ZnO NPs. When compared to bare ZnO NPs, the PL intensity of near-band-edge emission at 381 nm was practically suppressed, suggesting a lower rate of photogenerated electron–hole (e−/h+) pairs recombination, resulting in enhanced photocatalytic activity. Under solar light, the composite nanostructures displayed a photodegradation efficiency of 98.16% towards of RhB dye. After four trials, the structural stability of ZnO–CdS NCs was verified.