In particle therapy, knowledge of the stopping-power ratio (STPR) of the ion beam for water and air is necessary for accurate ionization chamber dosimetry. Earlier work has investigated the STPR for pristine carbon ion beams, but here we expand the calculations to a range of ions (1 ≤ z ≤ 18) as well as spread-out Bragg peaks (SOBPs) and provide a theoretical in-depth study with a special focus on the parameter regime relevant for particle therapy. The Monte Carlo transport code SHIELD-HIT is used to calculate complete particle-fluence spectra which are required for determining the STPR according to the recommendations of the International Atomic Energy Agency. The STPR at a depth d depends primarily on the average energy of the primary ions at d rather than on their charge z or absolute position in the medium. However, STPRs for different sets of stopping-power data for water and air recommended by the International Commission on Radiation Units and Measurements are compared, including also the recently revised data for water, yielding deviations up to 2% in the plateau region. In comparison, the influence of the secondary particle spectra on the STPR is about two orders of magnitude smaller in the whole region up till the practical range. The gained insights enable us to propose simple analytical expressions for the STPR for both pristine and SOBPs as a function of penetration depth depending parametrically on the practical range.