How is spectroscopy used in chemistry?