The observation of the quantum states of motion of a macroscopic mechanical structure remains an open challenge in quantum-state preparation and measurement. One approach that has received extensive theoretical attention1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 is the integration of superconducting qubits as control and detection elements in nanoelectromechanical systems (NEMS). Here we report measurements of a NEMS resonator coupled to a superconducting qubit, a Cooper-pair box. We demonstrate that the coupling results in a dispersive shift of the nanomechanical frequency that is the mechanical analogue of the 'single-atom index effect'14 experienced by electromagnetic resonators in cavity quantum electrodynamics. The large magnitude of the dispersive interaction allows us to perform NEMS-based spectroscopy of the superconducting qubit, and enables observation of Landau–Zener interference effects—a demonstration of nanomechanical read-out of quantum interference.