  (Abridged) Aims:We develop a method for deriving distances from spectroscopic
data and obtaining full 6D phase-space coordinates for the RAVE survey's second
data release. Methods: We used stellar models combined with atmospheric
properties from RAVE (Teff, logg and [Fe/H]) and (J-Ks) photometry from
archival sources to derive absolute magnitudes. We are able to derive the full
6D phase-space coordinates for a large sample of RAVE stars. This method is
tested with artificial data, Hipparcos trigonometric parallaxes and
observations of the open cluster M67. Results: When we applied our method to a
set of 16 146 stars, we found that 25% (4 037) of the stars have relative
(statistical) distance errors of < 35%, while 50% (8 073) and 75% (12 110) have
relative (statistical) errors smaller than 45% and 50%, respectively. Our
various tests show that we can reliably estimate distances for main-sequence
stars, but there is an indication of potential systematic problems with giant
stars. For the main-sequence star sample (defined as those with log(g) > 4),
25% (1 744) have relative distance errors < 31%, while 50% (3 488) and 75% (5
231) have relative errors smaller than 36% and 42%, respectively. Our full
dataset shows the expected decrease in the metallicity of stars as a function
of distance from the Galactic plane. The known kinematic substructures in the U
and V velocity components of nearby dwarf stars are apparent in our dataset,
confirming the accuracy of our data and the reliability of our technique. We
provide independent measurements of the orientation of the UV velocity
ellipsoid and of the solar motion, and they are in very good agreement with
previous work. Conclusions: The distance catalogue for the RAVE second data
release is available at http://www.astro.rug.nl/~rave
