In situ spectroscopy in solid state chemistry