A mass spectrometer is an analytical instrument used to measure the mass-to-charge ratio of ions. It plays a crucial role in identifying the composition and structure of substances by providing precise measurements that are essential for both relative and absolute dating methods in Earth science.