“Colors” of an atom in an X-ray region tell us a chemical state of the atom, which is one of the most important clues to understand the origin of materials properties. I have studied on resonant X-ray diffraction spectroscopy, which is a so-called coupling of X-ray diffraction (XRD) and X-ray absorption spectroscopy (XAS and also called as XAFS). This technique enables to reveal valence states and local structure of an element at each crystallographic site and phase. I developed a fast measurement technique of diffraction anomalous fine structure (DAFS) and a direct analysis using the logarithmic dispersion relation. This technique was applied to a battery material for the first time, which revealed a degradation mechanism of the first charge/discharge cycle of lithium-ion batteries.