Pairs of negatively charged phosphate groups and positive magnesium ions represent a key structural feature of DNA and RNA embedded in water. Vibrations of phosphate groups have now been established as selective probes of such contact pairs and allow for a mapping of interactions and structure on the ultrafast time scales of molecular dynamics.