Interposing a programmable path length of one or more materials into a particle beam modulates scattering angle and beam range in a predetermined manner to create a predetermined spread out Bragg peak at a predetermined range. Materials can be “low Z” and “high Z” materials that include fluids. A “high Z” and, independently, a “low Z” reservoir, arranged in series, can be used.