As stated in Stellar Motions, the motion of a star relative to the Sun is referred to as its space velocity, and is divided into its radial velocity, toward or away from the Sun, and its tangential velocity, perpendicular to the radial velocity (hence, in the plane of the "sky"), as shown in the diagram below:
The motion of a star, relative to the Sun.
Motion toward or away from the Sun is called radial velocity.
Motion perpendicular to the direction to the Sun is called tangential velocity.
The combination of the two motions is the star's space velocity.
Measuring Radial Velocities
Radial velocity is measured in terms of the change in the distance from the sun to the star. If this is increasing (the star is moving away from us), the radial velocity is positive; if it is decreasing (the star is moving toward us), the radial velocity is negative. We cannot use the radial velocity to decide whether the star is "really" moving toward or away from the Sun, or vice-versa; what it measures is the relative motion of the Sun and star. To measure some kind of absolute motion in space we would have to define a reference frame, based (for example) on the average motion of stars in our vicinity. This would involve a tremendous amount of work, and as we learn more, might well prove to be completely meaningless.
The radial velocity of a star is measured by the Doppler Effect that its motion produces in its spectrum, and unlike the tangential velocity or proper motion, which may take decades or millennia to measure, is more or less instantly determined by measuring the wavelengths of absorption lines in its spectrum.. This can be accomplished regardless of the star's distance from the Sun, providing that it is bright enough to observe its spectrum, in the first place. The only way that the star's distance affects the measurement is that the further away it is, the fainter it appears, and the longer it takes to collect enough light to observe its spectrum.
Background Physics: The Doppler Effect
(Discussion of the Doppler Effect, and how it can be used to measure radial velocities.)
(Discussion of correcting for the Earth's orbital motion)
(Discussion of correcting for perturbations of our motion, e.g. due to the Moon)
Radial Velocities in Multiple Star Systems
(Discussion of variable radial velocities, and their causes: lead-in to Spectroscopic Binaries)
(discussion of radial velocities to determine the masses of stars, clusters of stars, and galaxies)
Radial Velocities in the Universe
(Discussion of the radial velocities of galaxies: lead-in to the Expansion of the Universe)