  Non-LTE line formation for Pr II and Pr III is considered through a range of
effective temperatures between 7250 K and 9500 K. A comprehensive model atom
for Pr II/III is based on the measured and the predicted energy levels, in
total, 6708 levels of Pr II and Pr III. We describe calculations of the Pr II
energy levels and oscillator strengths for the transitions in Pr II and Pr III.
The influence of departures from LTE on Pr abundance determinations is
evaluated. At Teff >= 8000 K departures from LTE lead to overionization of Pr
II and to systematically depleted total absorption in the line and positive
abundance corrections. At the lower temperatures, different lines of Pr II may
be either weakened or amplified depending on the line strength. The non-LTE
effects strengthen the Pr III lines and lead to negative abundance corrections.
Non-LTE corrections grow with effective temperature for the Pr II lines, and,
in contrast, they decline for the Pr III lines. The Pr II/III model atom is
applied to determine the Pr abundance in the atmosphere of the roAp star HD
24712 from the lines of two ionization stages. In the chemically uniform
atmosphere with [Pr/H] = 3, the departures from LTE may explain only small part
(0.3 dex) of the difference between the LTE abundances derived from the Pr II
and Pr III lines (2 dex). We find that the lines of both ionization stages are
described for the vertical distribution of the praseodymium where the Pr
enriched layer with [Pr/H] > 4 exists in the outer atmosphere at log tau_5000 <
-4. The departures from LTE for Pr II/III are strong in the stratified
atmosphere and have the opposite sign for the Pr II and Pr III lines. Using the
revised partition function of Pr II and experimental transition probabilities,
we determine the solar non-LTE abundance of Pr as log (Pr/H) = -11.15\pm0.08.
