Resonant X-ray scattering techniques were applied for crystal-structure analyses for determining the valence state, charge ordering and magnetic structures in various minerals and inorganic compounds. The article includes the topics on absorption edge, Kramers-Kronig relation, anomalous scattering factors, two-wavelengths anomalous dispersion method, valence-difference contrast method, resonant scattering in electronic transition and resonant X-ray magnetic scattering.