RemiJP makes some excellent points and I second the recommendation of staying in Boston car free. The Amtrak and local commuter rail and subway systems will get you anywhere you want to go locally and state wide.
For hotels, I'd try to stay somewhere in downtown Boston or Cambridge. It's VERY safe (the rougher neighborhoods are really further outside the city center). My go to site is
Hotwire for Boston (or any other major cities) hotels. Hotwire has a partnership with many 2-4 star hotels and it can get you rates for about 1/2 of what orbitz, priceline, travelocity or even a direct hotel website can get you as Hotwire is used to fill vacant rooms. The catch is that Hotwire won't reveal the name of the hotel to you until AFTER you pay. What it does is gives you a neighborhood where the hotel is located and a star rating for the hotel (2 to 4 stars) and a price. In Boston this is great. Any hotel in the Theatre District, Back Bay, Beacon Hill, Financial District, Cambridge, Faneuil Hall area, North End and West End will be in an EXCELLENT location (in terms of safety and proximity to attractions).
Some people don't like that they can't see the name until after they pay (the reason hotels won't allow you to see it first is because it would technically be a lower-than advertised price and hurt business), but it really saves the folks who are willing to go for it a ton of money. A quick search of their inventory showed that you can get a 3.5 star hotel in the Quincy Market area (a prime spot) for $76/night the week of July 5- July 11. OR you can get a 4 star on Copley Plaza (great spot in the Back Bay) for $96/night that same week. That's a hell of a deal. It's prime location (right next to all transit lines) and cheaper than what you'd pay for a dumpy motel 25 miles outside the city on most other sites. I'd HIGHLY recommend doing it. The Copley Square hotel is most likely the Marriott Copley Place, and there are a number of Quincy Market area ones including the Marriott Long Wharf or Custom House hotel. I know it sounds like I'm advertising them (No, I really don't work for them or have ANYTHING to gain), but I really don't understand why more people don't take advantage of this service.
Anyway, once you're situated in Boston (again, I must emphasize trying to say in one of the central neighborhoods), I'd recommend using public transit to get around (here's the
public transit website); it's fast, easy and safe. Boston is also VERY walkable. You really don't want a car in town. It's a burden and an expensive one (you're looking at $40 for a few hours of parking each day in town). Via mass transit you can affordably and quickly reach the Maine Coast (Amtrak's Downeaster), Cape Cod's beaches (high-speed ferry to Provincetown from Rowe's Wharf downtown), Providence, RI (Amtrak and MBTA Commuter Rail), Plymouth, Salem, Gloucester, Rockport, etc (all by MBTA commuter rail and all worth a day or afternoon trip), and a bunch of locations West of Boston. The subway (Red, Green, Orange, and Blue Lines) will get you anywhere you want to go within Boston and many of its surrounding cities (like Cambridge, Somerville, Revere, Quincy, Newton, etc). This is the best, cheapest and easiest way for a tourist to see the area.
Anyway, I hope this is helpful. Enjoy your trip!