  Many modern theories predict that the fundamental constants depend on time,
position, or the local density of matter. We develop a spectroscopic method for
pulsed beams of cold molecules, and use it to measure the frequencies of
microwave transitions in CH with accuracy down to 3 Hz. By comparing these
frequencies with those measured from sources of CH in the Milky Way, we test
the hypothesis that fundamental constants may differ between the high and low
density environments of the Earth and the interstellar medium. For the fine
structure constant we find \Delta\alpha/\alpha = (0.3 +/- 1.1)*10^{-7}, the
strongest limit to date on such a variation of \alpha. For the
electron-to-proton mass ratio we find \Delta\mu/\mu = (-0.7 +/- 2.2) * 10^{-7}.
We suggest how dedicated astrophysical measurements can improve these
constraints further and can also constrain temporal variation of the constants.
