I've thought about this many times and wondered what I should do if I ever came upon an accident.
Did a little research, and found that most states do have "Good Samaritan Laws" that help protect people who try to help accident victims. This site lists the statutes state-by-state.
However, as this site notes, such laws don't necessarily stop a "victim" of your good intentions from suing you.