In a method for determining the ventilation of a lung of an object under examination by magnetic resonance imaging, at least two first lung-representing image data sets are acquired at different intervals of the breathing phase. The density change of the lung tissue is automatically determined from the signal difference between the image signals of the first image data sets in at least one corresponding region of the first lung-representing image data set. The lung or the thorax volume is automatically determined using at least two of the first image data sets, or using at least an additional second lung-representing image data set in a breathing phase that corresponds with the breathing phase of a first image data set. The localized, quantitative ventilation of the lung is automatically calculated depending on the density change of the lung tissue and the change of the lung or thorax volume.