You'd be taking the commuter rail from Nantasket Junction if you stay @ Nantasket Beach. Here's the schedule for it. I wouldn't hesitate to stay near this beach, but that's just my opinion, I'm a coastal person and always chose anything near the ocean!
www.mbta.com/schedules_and_maps/rail/lines/…
From Quincy you'd be able to take the subway. It would be the red line:
mbta.com/schedules_and_maps/subway/lines/…
From Hull you'd be about 45 minutes from Boston & roughly 19 miles away. Driving it, you'd come up 3A-N to the Neponset River Bridge which then becomes Morissey Blvd, then you'd pick up I-93N. In the summer months it can get crazy with the traffic, but if that's where you end up staying, you just have to deal with it. Know when to travel it, that's all. Fridays are always hectic with every one going away, so try to avoid driving it that day.
Quincy on the other hand, would only be about 10 minutes away from Boston. Roughly 5 1/2 miles, if that.
Good luck wherever you stay!