A systematic derivation of the distribution function of excited ions formed by charge-exchange recombination is presented. The following effects have been taken into account: (1) Finite lifetime of the excited state; (2) energy dependence of the charge-exchange reactivity; (3) nonuniformity of the neutral beam. It is pointed out that the contribution of the terms related to the ion temperature gradient has a different structure compared to the other terms, thereby allowing a direct measurement of the ion temperature gradient. Possible ways for improving the accuracy of electric field measurements are discussed. [S1070-664X(00)01404-X].