Thin cadmium sulfide (CdS) films (100-130 nm) are deposited on glass from an alkaline solution. The films are annealed in air, in the vicinity of a CdCl2 source, at different temperatures (280-400degreesC) and for different time periods (below 75 min). The change in some of the optoelectronic parameters (resistivity, direct and indirect transition energies) as a result of annealing is studied using modulated photocurrent spectroscopy. The experimental results reveal that annealing in air, in the absence of a CdCl2 source, reduces the bandgap energy of US by 0.12 eV due to the formation of valence-band states. Annealing in CdCl2 vapour removes the tail states and establishes the bulk bandgap (2.42 eV). It also increases the film's photoconductivity by a factor of 10 under white light illumination of intensity 100 mW cm(-2), yielding a dark-to-light resistivity ratio of 3 x 10(4). The film's optoelectronic properties are controlled by two defect energy levels that are located at 0.14 and 1.30 eV below the conduction band edge. The increase in photoconductivity by annealing is due to the improvement of excess carrier lifetime as a result of changes in the 1.30 eV energy level.