For a standard tomato sauce that has a balance of light and heavy flavours, a similarly balanced beer would be best suited, like an amber ale. The hops of an amber ale cuts through the acidity of the tomato and the slight sweetness of the beer highlights the subtle sweetness of the sauce.
A spicy meat-based tomato sauce would pair best with an India pale ale. The additional hops of an IPA are able to cut through the spice and heavy meats that are featured in the sauce while cooling down your palette.
Pesto sauce is made with strong herbs that are best suited with a Belgian ale. The herbs and spices of a Belgian ale match the aroma of pesto. The slight sweetness of the ale enhances the flavours of the vegetables in the sauce.
Alfredo sauce has a rich and creamy texture that is best paired with a stout. Stouts are one of the heaviest types of beer which compares well with the richness of Alfredo sauce. An oatmeal stout would match nicely as the slight sweetness of the beer would highlight the creamy texture of the sauce.
When pairing beer and pasta, you are matching the beer to the sauce as the base pasta is made with the same ingredients. The yeast in beer will always bring out the grainy texture of pasta, but different types of beer are needed for the wide range of sauces.