There's a lot of great beer to be found in Boston/Cambridge. Here's some of my favorites, sort of in order of my preference with a note on the approximate travel time from downtown...
Brewpubs:
Cambridge Brewing Company, a renowned brewpub, one of the oldest with a highly developed Belgian-style and cellaring program. Masterful Barleywines. Focus on their specialty list, but the house beers are nice, too. Cask ale on Tuesday evenings for the couple hours it usually lasts.
Cambridge, about 10 minutes by Redline subway.
The Tap, very fine brewpub with a very nice Alt and nice German lagers when they have one on tap. Popular low gravity IPA.
Haverhill, about 45-60' north of Boston by the Commuter Rail (the station is right across the street from the pub) or by car.
John Harvard, decent choice if you visit Harvard square, about 15' on the Red Line subway.
Boston Beer Works, decent to excellent, depending on the particular beer.
Boston, very close to either Fenway or the Garden, and Salem, a pretty old town about 45'-60' north of Boston by Commuter Rail or car.
Pubs:
Redbones, a BBQ place with a great rotating beer list of mostly New England and West Coast beers, with some Belgians, Germans and Brits. Always 1 cask ale on.
Davis Square Somerville, 15' by Redline subway.
I'm really fond of The Independent, in Union Square Somerville, too. It's a bit on the quiet side during the week, which I like sometimes, and it has a great beer list and most of the bartenders are happy to talk about beer, but you can really only get there by cab, maybe 10'.
Deep Ellum, interesting rotating beer list often with interesting Belgians, Belgian influenced local beers and IPAs.
Allston, about 15' by cab or Green Line subway with a little walking.
Lord Hobo, a beer focused pub. I have mixed feelings about it, but some people love it and it has a great beer list.
Inman Square Cambridge, about 5-10' walk from the Cambridge Brewing Company.
Bukowski's, good draft list, great bottle list, a bit expensive.
Near the Prudential Center and another very close to Lord Hobo and the CBC.
Breweries:
You can get in to Harpoon in about 15' on the Silver Line, and the Sam Adams experimental brewery is about as far on the Orange line.
There's more Brewpubs and pubs, but those are some of my favorites.