Polarisable atoms and molecules experience the Casimir-Polder force near magnetoelectric bodies, a force that is induced by quantum fluctuations of the electromagnetic field and the matter. Atoms and molecules in relative motion to a magnetoelectric surface experience an additional, velocity-dependent force. We present a full quantum-mechanical treatment of this force and identify a generalised Doppler effect, the time delay between photon emission and reabsorption, and the Roentgen interaction as its three sources. For ground-state atoms, the force is very small and always decelerating, hence commonly known as quantum friction. For atom and molecules in electronically excited states, on the contrary, both decelerating and accelerating forces can occur depending on the magnitude of the atomic transition frequency relative to the surface plasmon frequency.