re
Hero's do the right thing because it is the right thing to do irregardless of risk to one's own life or position. A powerful sense of moral duty drives heroes to do the right thing. The right thing is often obvious, but it can't just be the individual's personal opinion on what is the right thing to do, but a universal idea of the right thing to do. For example, a person who witnesses a mob murder, then testifies against the mob even though he or she knows they are probably going to be killed is a hero. This is how I play heroic characters in D&D.
For example, a paladin character of mine witnessed a suicidal gnome throw himself into a pit of fire during a great battle in an evil fire temple. My paladin requested a fly spell from the cleric, then flew into the pit,grappled the gnome, and flew out with him. He rescued the gnome because it was the right thing to do irregardless of the battle around him or the danger to his own life.
Being a hero is often a mind set as well as being in the right place at the right time. You really have to have a high regard for the lives of others and a well-developed sense of moral duty so that the first thing that occurs to you is the right moral action to take. For example, if you are rescuing a child from a burning building, you can't be more afraid of the fire than concerned about rescuing the child, or you won't even try to rescue the child. Without a powerful sense of moral duty driving you, you probably won't be apt to do what is necessary to become a hero.
I would say a very important trait of heroes is a powerful sense of moral duty.