A few comments on what people have said.
Take the public transportation for sure! Take the subway, known as the T. Very cheap and it'll get you anywhere.
Also, what's been said about the 4th down there is true, except the skipping it part! Tons of crowds, although it's great to go there. If you decide to go there, bring a blanket and grab some food. I suggest going to the Cambridge side to watch the fireworks, less people, and you can still hear the music. There used to be speakers on the Cambrige side, but last year they stopped putting them there, but you can still hear the music from the speakers across the river.
However, if you're hotel is within reasonable walking distance, just walk to the Boston side and stake your ground there. That way, you won't have to bother driving, or taking the T, back to the hotel, which is a complete disaster.