Nanostructured ternary PbMgS thin films with different Mg concentrations (0, 2, 4, 6 and 8 at.%) were prepared on glass substrates kept at 400 °C by spray pyrolysis technique. Crystalline quality, morphology, optical and electrical properties of the as deposited PbMgS thin films were characterized using X-ray diffraction, field emission scanning electron microscopy (FESEM), UV–Vis–NIR double beam spectrophotometer and two point probe setup respectively. It is observed that both the undoped and doped PbS films have face-centered cubic structure with a (2 0 0) preferential orientation. Appearance of the 2LO mode in the Raman spectra revealed good crystalline quality of the as deposited films, and the characteristic bands agrees with that of galena PbS. Decreased crystallite size observed with doping leads to an increase in the optical band gap values from 2 to 2.18 eV which may be attributed to quantum size effect. FESEM images clearly show that the as synthesized PbMgS thin film morphology modifies from nano sized needles to disc shaped structures with Mg incorporation. The addition of Mg into PbS lattice was confirmed by EDX analysis. Electrical studies show that the film resistivity decreases from 7.29 × 103 to 0.4369 × 103 Ω-cm with increase in Mg concentration. Enhancement in the film transparency, widened band gap energy and decreased resistivity observed make PbMgS thin films suitable for solar cell applications.