Using the method of successive ionic-layer adsorption from water solutions of different composition, the InS films on the surface of TiO and porous anodic AlO have been formed. It has been found that the composition of cationic and anionic solutions-precursors affect the optical band gap of the films, which varies within the 1.97-2.65 eV range, that is explained from positions of the oxygen content change in InS. The discovered dependencies of optical properties on the pH value of anionic precursors and the anion nature in the cationic precursors well agree with the calculated conditions of chemical equilibrium in the investigated systems. The efficiency dependence of the photo electrical transformation of solar elements with the extremely thin absorbing layers on the oxygen content in the InS films, produced by successive ionic-layer adsorption, has been demonstrated.