Energy storage is a critical but weak link in the chain of modern sustainable energy applications. The pressing demand of improving energy storage systems, especially for electric vehicles, calls for speedy strategies for developing materials based on advanced analytic tools. Synchrotron based soft x-ray spectroscopy is one of such incisive tools that probes the key electronic states pertaining to the performance of batteries. This presentation starts with introductions on what kind of electronic information could be valuable for batteries and be obtained through soft x-ray spectroscopy. We will showcase two examples on how soft x-ray spectroscopy provides valuable information for developing materials and understanding mechanism of batteries. We then discuss our recent developments of in-situ and operando soft x-ray techniques for studying batteries. The unprecedented soft x-ray results reveal the charge dynamics and mesoscale effects in battery operations, which cannot be obtained through other techniques. Advanced Materials 23, 4679 (2011); JACS, 134, 13708 (2012).