A therapeutic apparatus comprising: - a magnetic resonance imaging system adapted for acquiring a set of magnetic resonance imaging data in an imaging zone, the magnetic resonance imaging system comprising a means for generating a magnetic field, - a guiding means adapted for guiding a beam of charged particles to a target zone within a subject, wherein the imaging zone comprises the target zone, - a zone determination means adapted for determining the location of the target zone within the subject using the set of magnetic resonance imaging data, - a trajectory calculation means adapted for calculating a trajectory of the beam using magnetic field data being descriptive of the magnetic field such that the calculated trajectory reaches the target zone, - a control means adapted for controlling the guiding means using the calculated trajectory such that the beam follows the calculated trajectory.