A method controls an expiratory gas flow at a user interface (16) of a ventilator (1) wherein the user interface (16) has an exhalation valve (11), which provides a positive end-expiratory pressure (PEEP). The method includes the following steps during a phase of exhalation: changing the positive end-expiratory pressure from a basic PEEP value (31) with the exhalation valve (11); returning the positive end-expiratory pressure to the basic PEEP value (31) with the exhalation valve (11); and determining an exhalation parameter. The method permits an adaptive change in the expiratory flow during the exhalation. Air trapping can be avoided, and it is possible to respond to changed exhalation parameters within one and the same phase of exhalation.