A method and system for gating therapeutic or diagnostic energy to a tissue volume of a medical patient during a selected portion of the patient's respiratory cycle, to thereby diminish inaccuracies in the assumed spatial position of the tissue volume arising from displacements induced by the patient's respiration. The gases flowing to and from the patient's lungs are monitored to provide quasi-continuous measurements as a function of time, for any selected subset of (a) flow rate, (b) pressure, (c) patient lung volume and (d) carbon dioxide concentration. The measurements are utilized to trigger the time period during which the energy is gated on, at the beginning of the selected portion of the respiration cycle; and the time period during which the energy is gated on, is terminated at the end of the selected portion of the respiration cycle.