A contribution to evaluation of influence of medium in electronic and infrared spectroscopy