The past two decades have seen rapid developments in short-pulse X-ray sources, which have enabled the study of nuclear and electronic dynamics by ultrafast X-ray spectroscopies with unprecedented time resolution ranging from nanoseconds to attoseconds. In this Perspective, we discuss some of the major achievements in the study of nuclear and electronic dynamics with X-ray pulses produced by high-harmonic, free-electron-laser and synchrotron sources. The particular dynamic processes probed by X-ray radiation highlighted in this Perspective are electronic coherences on attosecond to femtosecond timescales, chemical reactions, such as dissociations, and pericyclic ring-openings, spin-crossover dynamics, ligand-exchange dynamics and structural deformations in excited states. X-ray spectroscopic probing of chemical dynamics holds great promise for the future owing to the ongoing developments of new spectroscopies, such as four-wave mixing, and the continuous improvements in emerging laboratory-based, high-harmonic sources and large-scale, facility-based, free-electron lasers.