Standard processes for producing CdS layers for solar cells are vapour deposition and sputtering. In these processes, the material and power consumption are fairly high and the cell size which can be produced is limited. In the proposed process, a CdS layer is deposited on a substrate from an electrolyte containing a cadmium salt and sulphur-containing compounds by alternating-current electrolysis and a polycrystalline CdS layer is then produced by a heat-treatment process.