How to help a stray dog

Last Sunday I saw a beautiful golden retriever on the side of a busy street, lined with businesses and homes. She was at the end of a long driveway, and it was possible that she lived in the house up the drive and had been trained to go no further than she was. But one more step and she would have been in trouble.

For as long as I could see, I watched her standing, not moving, looking at the cars whizzing by. I was so worried for her, but I didn't know what to do. Should I turn around, find a place to pull over, and approach her to search for ID tags? What if approaching her caused her to dart out into the road? If she had no tags, would I then take her into my car and drive off with her? What if the owner was nearby, claiming I was stealing his dog? Or watching from out the window of a house? No, I don't think it's responsible to let your dog loose around a busy street, but maybe the dog was on it's own property. Should I have gone up to the house, rung the bell, and asked if that was their dog standing at the end of the driveway?

I certainly didn't want this dog to get hit by a car, but couldn't decide about the right thing to do.
Have you ever been in this position? What did you do?