I'm not sure why people recommend bringing a hammer along to hit the frame with. It will only tell you something if the rust is really bad, meaning you can already tell without the use of a hammer. On top of that, most frames with bad internal rust are going to be able to withstand the blow of a hammer without crumbling in. Sure, people might have covered some bad rust up and a hammer might expose that, but if you know what you're looking for, any of those cover up jobs are very easy to spot. And anyway, people who covered frame rot up aren't going to let you hit the frame in the first place.
The best way to tell the internal condition on the frame is with a a camera that you can fish into the frame through some of the holes.
On a side note, I certainly wouldn't want some random person hitting the underside of my vehicle with a hammer. If I was trying to sell a vehicle and someone asked to hit the underside of it with a hammer I'd tell them to get lost.