We describe a new mechanism of dark matter production in the early Universe, based on thedynamics of a first order phase transition. We assume that dark matter particles acquire massduring the phase transition, making it energetically unfavourable for them to enter the expandingbubbles of the massive phase. Instead, most of them are reflected off the advancing bubble wallsand quickly annihilate away in the massless phase. The bubbles eventually merge as the phasetransition is completed, and only the dark matter particles which have entered the bubbles surviveto constitute the observed dark matter today. This mechanism can produce dark matter with massesfrom the GeV scale to above the PeV scale, including a large region of viable parameter space beyondthe Griest–Kamionkowski bound. Current and future direct detection and collider experiments canprobe much of the viable parameter space.