We have recently shown that the electromagnetic pulse in a medium is made of mass-polariton (MP) quasiparticles, which are quantized coupled states of the field and an atomic mass density wave (MDW) [M. Partanen, Phys. Rev. A 95, 063850 (2017)2469-992610.1103/PhysRevA.95.063850]. In this work, we generalize the MP theory of light for dispersive media assuming that absorption and scattering losses are very small. Following our previous work, we present two different approaches to the coupled state of light: (1) the MP quasiparticle theory, which is derived by only using the fundamental conservation laws and the Lorentz transformation; (2) the classical optoelastic continuum dynamics (OCD), which is a generalization of the electrodynamics of continuous media to include the dynamics of the medium under the influence of optical forces. We show that the total momentum and the transferred mass of the light pulse can be determined in a straightforward way if we know the field energy of the pulse and the dispersion relation of the medium. In analogy to the nondispersive case, we also find unambiguous correspondence between the MP and OCD theories. For the coupled MP state of a single photon and the medium, we obtain the total MP momentum pMP=np ω/c, where np is the phase refractive index. The field's share of the MP momentum is equal to pfield= ω/(ngc), where ng is the group refractive index and the share of the MDW is equal to pMDW=pMP-pfield. Thus, as in a nondispersive medium, the total momentum of the MP is equal to the Minkowski momentum and the field's share of the momentum is equal to the Abraham momentum. We also show that the correspondence between the MP and OCD models and the conservation of momentum at interfaces gives an unambiguous formula for the optical force. The dynamics of the light pulse and the related MDW lead to nonequilibrium of the medium and to relaxation of the atomic density by sound waves in the same way as for nondispersive media. We also carry out simulations for optimal measurements of atomic displacements related to the MDW in silicon. In the simulations, we consider different waveguide cross sections and optical pulse widths and account for the breakdown threshold irradiance of materials. We also compare the MP theory to previous theories of the momentum of light in a dispersive medium. We show that our generalized MP theory resolves all the problems related to the Abraham-Minkowski dilemma in a dispersive medium.