We propose a method for quantitatively taking into account nonselective absorption for systems in which the vapor phase contains a single molecular form: sodium and potassium chlorides and iodides. We identified the absorption bands using modern quantum chemistry methods. We have demonstrated good agreement between the experimental data and the calculations. We have tested the correctness of the method we developed for the example of determining known silicon and iron contents in potassium chloride and sodium iodide. Differences between the results obtained and the true elemental contents were random.