  We demonstrate a novel method to determine the longitudinal phase-space
distribution of a cryogenic buffer gas beam of barium-fluoride molecules based
on a two-step laser excitation scheme. The spatial resolution is achieved by a
transversely aligned laser beam that drives molecules from the ground state
$X^2\Sigma^+$ to the $A^2\Pi_{1/2}$ state around 860 nm, while the velocity
resolution is obtained by a laser beam that is aligned counter-propagating with
respect to the molecular beam and that drives the Doppler shifted
$A^2\Pi_{1/2}$ to $D^2\Sigma^+$ transition around 797 nm. Molecules in the
$D$-state are detected virtually background-free by recording the fluorescence
from the $D-X$ transition at 413 nm. As molecules in the ground state do not
absorb light at 797 nm, problems due to due to optical pumping are avoided.
Furthermore, as the first step uses a narrow transition, this method can also
be applied to molecules with hyperfine structure. The measured phase-space
distributions, reconstructed at the source exit, show that the average velocity
and velocity spread vary significantly over the duration of the molecular beam
pulse. Our method gives valuable insight into the dynamics in the source and
helps to reduce the velocity and increase the intensity of cryogenic buffer gas
beams. In addition, transition frequencies are reported for the $X-A$ and $X-D$
transitions in barium fluoride with an absolute accuracy below 0.3 MHz.
