X-Ray Spectroscopy with Synchrotron Radiation: Fundamentals and Applications