Sm-doped CdS thin films prepared by spray pyrolysis: a structural, optical, and electrical examination