There's a little-known place outside of Davis Square Somerville (red line) called What's Cookin' on College Ave. The owner is a skilled pastry chef and makes things like Chocolate Bread Pudding with Caramel Bourbon sauce; Triple Chocolate Mousse Cake; Pear Almond Tart... and nothing is over $3 a slice!
For authentic Italian pastry, go to The Modern Pastry Shop on Hanover Street in the North End, a short walk from the Haymarket T stop. There are a few tiny tables, but it's mostly a take-away place. Take away some almond biscotti, little ricotta pies, something gloppy from the fridge. They make other places seem merely sugary.
If you are taking the train into South Station, try Rosie's. They have an outlet in the station. If you have a car, Lakota bakery on Mass Ave. in Arlington which wholesales delicious cookies, also does nice cakes. Frommagios (spelling) in Cambridge and the South End has nice pastries. In Brookline on Beacon and Washington st. is Athan's, a very European shop, and very good. good luck.