This app was mentioned in 5 comments, with an average of 3.00 upvotes
To add to this, you can buy a paper ticket at one of the fare vending machines / windows at Back Bay, or you can use the mTicket app (iPhone, Android) to buy a ticket, and then you show the conductor your phone on the train.
If you get on at a station where you could have bought a ticket, they'll charge you an additional $3 on top of the fare to pay with cash on board.
So, you're in the Boston area. First, you need this to buy your commuter rail ticket https://play.google.com/store/apps/details?id=com.mbta.mobileapp
Then you can buy a Charlie card at any station to put money on for a bus ticket. It's easy-peasy.
Ask more questions if you're still not sure.
You'll need to buy a ferry ticket at the ticket booth located on the pier or use the mTicket App, they don't use the CharlieCard
https://www.mbta.com/fares/ferry-fares
MTicket App https://play.google.com/store/apps/details?id=com.mbta.mobileapp&hl=en\_US&gl=US
You might want to switch over to the app:
iOS: https://apps.apple.com/us/app/mbta-mticket/id560487958
Android: https://play.google.com/store/apps/details?id=com.mbta.mobileapp&hl=en