Well beer is mostly water. Water has a triple point of 611 pascals at 0C. (Normal atmospheric pressure is 100 kilopascals) So below that pressure, water can't exist as a liquid. You can keep it frozen, if you keep it cold enough, but otherwise, its going to be a vapor. The temperature you need to keep it sold falls further, the lower the pressure goes, at 1 Pa its below -50C. The triple point of pure ethanol is at -123C and 0.00043 pascals - that's four ten-thousanths. The moon has an atmospheric pressure - if you can call it that - of about three billionths of a pascal, or about three quadrillionths of sea-level Earth pressure. So the alcohol is going to boil off, too, again, unless you make it very cold very fast.
You're not going to do that, because although space is commonly thought of as cold, in the absence of conduction or convection, the only way for things to lose heat is by radiation, which is very slow compared to the other two. Also, our astronaut is sitting in the sun, and solar radiation warms things just as well in a vacuum. So in other words he'd better chug his beer, it'll boil away in minutes at most.