Intraoperative radiation therapy involves a treatment head disposed on a distal end of a robotic arm. An X-ray component included as part of the treatment head generates therapeutic radiation in the X-ray wavelength range. At least one patient motion sensor detects a breathing movement of a patient body. A control system dynamically controls a position of the treatment head by causing a position variation in at least one of the movable joints comprising the robotic arm. This movement is managed so that a relative motion as between the treatment head and a tumor bed internal of the patient is minimized.