Magnetic Resonance guided Radiotherapy (MRgRT) is a new technology that combines MR imaging with a radiotherapy treatment machine. Due to the improved soft tissue visibility compared with Computed Tomography (CT) or Cone-Beam CT (CBCT), MRgRT promises more accurate treatments with improved normal tissue sparing for sites including prostate and cervix. MRgRT brings new clinical challenges. Not least of these is the effect that the permanent magnetic field has on the dose deposition within the patient. Of particular concern is the Electron Return Effect (ERE), where dose depositing electrons return back into tissue when they traverse a density boundary. The dosimetric effects of ERE around "unplanned" air cavities in Organs At Risk (OAR) has not been well studied. The aim of this thesis is to determine the dosimetric effects of rectal gas, when the rectum is an OAR, during pelvic MRgRT. Monte Carlo dose calculations irradiating virtual phantoms containing spherical air cavities of varying sizes, under the influence of a 1.5 T transverse magnetic field, were performed. To calculate the local dose perturbation around the cavities, the dose distributions in the phantoms containing air were compared to that of a reference phantom containing no air. Results show that dose perturbations up-to ~70 % occur around large air cavities in the path of a single beam. Further, it was found that large volumes of rectal gas in the path of a single beam could result in 1cc of the rectal wall receiving 45 % more dose than planned. Results also show that effects do not cancel out for multiple overlapping beams; dose differences of ~20 % were observed around large air cavities. Next, a single equation to predict the local dose perturbation due to ERE and differences of beam attenuation around a gas cavity of given size was derived. The equation is intended to be incorporated into the MRgRT work-flow to alert when the presence of gas causes dose constraints to be violated. In this thesis, the equation was incorporated into a illustrative web-based simulation tool to calculate the total uncertainties associated with MRgRT. The likelihood of large volumes of gas remaining stable in the rectum of pelvic cancer patients on inter- and intra-fractional time-scales was investigated. Results indicate that not only is rectal gas likely to remain stable during a 20-25 minute treatment fraction, it is also likely to return to the same place in multiple fractions. The derived equation was used to estimate the dose perturbation due to rectal gas over a single fraction and a 4 or 20 fraction treatment. The dosimetric benefit of accounting for gas in the daily adaption was also demonstrated. Finally the Treatment Planning System (TPS) dose calculation around air cavities, used throughout this thesis, was experimentally verified using GafChromic EBT3 film. Overall, results in this thesis show, for the first time, that unplanned rectal gas forming during pelvic MRgRT is likely to result in clinically concerning dosimetric effects, potentially increasing the risk of grade 2+ rectal toxicity.