Introduction to X-ray absorption spectroscopy