The ascent of magma to the Earth's surface is commonly modeled by assuming a fixed dike or flow geometry from a deep subsurface reservoir to the surface. In practice, however, this flow geometry is produced by deformation of the crust by ascending overpressured magma. Here, we explore how this elastic deformation is coupled to magma ascent using a model of a planar dike whose width is allowed to evolve with depth in the crust. The model predicts that, for points well below the surface, the dike gradually narrows with height above the source reservoir as the overpressure of the magma relative to the minimum horizontal stress in the crust decreases. For a bubbly compressible magma, the flow accelerates to the surface and reaches the speed of sound at the vent, as for rigid conduit flow. However, it is now able to decompress to atmospheric pressure at the vent by contraction of the conduit. Our calculations predict eruption rates on the order of 0.1–10 $m^2/s$ per unit length of a dike, for magma supplied from a reservoir with overpressure in the range − 10 MPa to + 20 MPa.