PurposeDue to differences in attenuation and the electron return effect (ERE), the presence of gas can increase the risk of toxicity in organs at risk (OAR) during magnetic resonance‐guided radiotherapy (MRgRT). Current adaptive MRgRT workflows using density overrides negate gas from the dose calculation, meaning that the effects of ERE around gas are not taken into account. In order to achieve an accurate adaptive MRgRT treatment, we should be able to quickly evaluate whether gas present during treatment causes dose constraint violation during an MRgRT fraction. We propose an analytic method for predicting dose perturbations caused by air cavities in OARs during MRgRT.MethodTen virtual water phantoms were created: nine containing a centrally located spherical air cavity and a reference phantom without an air cavity. Monte Carlo dose calculations were produced to irradiate the phantoms with a single 7 MV photon beam under the influence of a 1.5 T transverse magnetic field (Monaco 5.19.02 Treatment Panning System (TPS) (Elekta AB, Stockholm, Sweden)). Dose distributions of the phantoms with and without air cavities were compared. We used a spherical coordinate system originating in the center of the cavity to sample the dose distributions and calculate the dose perturbation as a result of the presence of each air cavity, ∆D%(θ,Φ)calc.. Dose effects due to ERE and differences in attenuation due to density changes were considered separately. Least squared analysis was used to fit the calculated dose perturbations to mathematical functions. Effects due to ERE were fit to a modulated sinusoidal function and those due to attenuation differences were fit to a 2D Gaussian function. We used the fits to derive a single equation describing dose perturbations around spherical air cavities as a function of angles, θ, Φ, distance from cavity surface, d, and cavity radius, r. We measured the fitting error by calculating the residual error (RE); the difference between the calculated and fitted dose perturbation.ResultsBoth ERE and differences in attenuation contribute toward the total dose effects of air cavities in MRgRT. Whereas ERE dominates close to the surface of the cavities, attenuation effects dominate at distances >0.5 cm from the cavities. We showed that dose effects around a spherical air cavity (≤1 cm from the surface) due to ERE fit a modulated sinusoidal function with mean (RE) ≤−1.4E‐5% and root mean square error (rms) (RE) ≤4.1%. Effects due to attenuation differences fit a Gaussian function with mean (RE) ≤0.7% and rms (RE) ≤1.8%. Our general equation, which we verified using multiple sizes of spherical and cylindrical air cavity, fits Monte Carlo simulated data with mean (RE) ≤±0.9% and rms (RE) ≤6.9%.ConclusionWe show that local dose perturbations around unplanned spherical air cavities during MRgRT can be well characterized analytically. We present an equation that can be incorporated into the clinical workflow to allow for fast evaluation of dose effects of unplanned gas. We also envision this method contributing to the clinical implementation of real time adaptive radiotherapy (ART) for MRgRT using MRI planning.