D.B.
Are you looking for towns, or specific hotels? You are usually safe at a chain hotel. Hampton Beach is a popular destination but FYI there is traffic gridlock, so get there and stay there. Canobie Lake is an amusement/water park in NH. Most of the Maine-goers I know go to Ogunquit, York or Wells. Be advised that the water is good and cold in Maine.
If you want warmer water, go to Cape Cod. That's where we always go. It offers warm water in Massachusetts Bay (the "bicep" of arm-shaped Cape Cod), light surf and slightly colder water in Nantucket Sound (below the arm sort of the "triceps" area), and regular ocean water and big surf from the "elbow" to the "hand" of the Cape. If you want to try that and need more info, let me know.
You could also do a whale watch which is great for kids of different ages. Whale watch boats leave from the Cape Ann area, south of NH but north of Boston, as well as Cape Cod. It's a long day but really interesting and they always see whales. Take sunscreen and your own food to save money but there's also food available on the boat.
Most seaside towns have stuff like mini golf. Not sure how old your older son is but most kids and adults can enjoy that.
There is phenomenal stuff to do in Boston too - if that interests you, let me know.