Soft x-ray spectroscopy and microspectroscopy of magnetic and naturally occurring materials