Binary diffraction gratings in As2S3 films were prepared with the aid of an electron beam. The dose of the electrons was varied. The gratings were read with a HeNe laser, and the zero-order and first-order diffraction efficiencies were noted. Rigorous diffraction theory was used to give a homogeneous approximation for the refractive index change. Reactive ion etching was applied to reduce the thickness of the film, and a new value for the refractive index change was evaluated. The refractive index change versus film thickness dependence was found to be linear at low electron doses and Gaussian shaped at higher doses. Through a simple mathematical analysis, the absolute value of the refractive index was determined as a function of the position inside the film. At higher doses, the refractive index change was found to have a maximum value of 3%, approximately 1.2 μm from the film surface.