We all wonder how we would react in an emergency. Would we risk our lives to help someone in danger?

Laurie Ann Eldridge found out last year. Looking up from her garden one evening at her Cameron, N.Y., home, Ms. Eldridge saw a confused 81-year-old driver stuck at a railroad crossing nearby, oblivious to the train speeding toward her car.

Ms. Eldridge raced barefoot to the car, wrestled out the disoriented woman, rolled with her down the railway embankment and covered her with her body, just seconds before the train demolished the automobile. Ms. Eldridge's feet were bloody and riddled with splinters. The elderly woman, Angeline C. Pascucci of Le Roy, N.Y., was unhurt.

It is hard to know for sure who will step up and who will freeze up in a crisis. But, amid growing interest in positive psychology, the study of human strengths and virtues, research in recent years has shed light on the qualities and attitudes that distinguish heroes from the rest of us.

Certain traits make it more likely that a person will make a split-second decision to take a heroic risk. People who like to take charge of situations, who respond sympathetically to others, and who have a strong sense of moral and social responsibility are more likely to intervene than people who lack those traits, research shows. Heroes tend by nature to be hopeful, believing events will turn out well. They consciously try to keep fear from hampering their pursuit of goals, and they tend to block out the possibility of injury or material loss.

People who are otherwise good and caring may still shrink back in a crisis. Their responses depend partly on whether they perceive the situation as an emergency and whether they know how to help; someone who doesn't know anything about electrical wiring probably won't rush to save a person tangled in a power line. How you're feeling that day makes a difference, too; "people who are in a good mood are more likely to help," says Julie M. Hupp, an assistant professor of psychology at Ohio State University in Newark. Context also matters; some researchers say a large crowd makes it less likely that an individual hero will step up.

Of course, it helps to be physically able. In a 1981 study of 32 people who had intervened to help victims of assaults, robberies or other serious crimes, researchers found the heroes were taller, heavier and more likely to have had training in rescuing people or responding to emergencies than a comparison group of people who hadn't intervened in a crime or emergency for 10 years.

But heroism is far more complex than that. Some heroes have qualities that enable them to blast through obstacles, recent research shows. Empathy, or care or concern for others, runs high in people with heroic tendencies, according to a 2009 study led by Sara Staats, a professor emeritus of psychology at Ohio State University in Newark.

Ms. Eldridge was an unlikely hero. She had no rescue training. At 5-foot-8 and 115 pounds, she was outweighed by the woman she saved. The biggest surprise to Ms. Eldridge, a single mother of two teenage boys, was that she was able to run at all. Until the day of the rescue, she hadn't run for 10 years because of a disabling back injury.

"All I could think about was the lady's face. She looked lost. She needed help, and she needed help right then," says Ms. Eldridge, who received a medal from the Carnegie Hero Fund Commission, which honors civilians who risk their lives to save others, last June.

A tendency to frame events positively and expect good outcomes is another hallmark of heroes, says Jeremy Frimer, an assistant professor of psychology at the University of Winnipeg. In a 2010 study, 25 Canadians who had won awards for risking their lives to save others were asked to tell stories about their lives. Heroes were more likely to "take something that's bad and turn it into something that's good," says Dr. Frimer, a co-author of the study with Lawrence Walker, a psychology professor at the University of British Columbia, and others. In an example from another study, Dr. Frimer says, a woman diagnosed with breast cancer described the disease as "re-energizing her creative side," saying her return to creating art was "a gift that came from the tragedy.'"

Heroes tend by nature to be hopeful, believing events will turn out well. Getty Images

When Stephen St. Bernard came home from work last month to his Brooklyn, N.Y., apartment building, neighbors had gathered outside. A 7-year-old child had squeezed out of her family's third-floor apartment window and was dancing on the air-conditioning unit outside, some 25 feet above the pavement.

All Mr. St. Bernard was thinking, he says, was "maybe I can catch her," says the 53-year-old bus driver for the Metropolitan Transportation Authority. "The weight of the child, how hard she was going to hit me—none of that crossed my mind," he says. "I was just hoping, praying, 'God, please don't let me miss.'"

As he moved beneath the window, the girl slipped and plummeted into his outstretched arms with an estimated 600 pounds of force, nearly ripping his arm off. He has had surgery to repair the torn muscles, tendons and nerves and will need months of painful physical therapy. But in describing the incident, he focuses on the fact that the child escaped injury or death. "Not a scratch was on that baby," he says.

Heroic people also tend to have a strong sense of ethics and above-average coping skills—a belief in their ability to tackle challenges and beat the odds, research shows. On the battlefield in Afghanistan last January, Navy nurse James Gennari knew, when he saw an injured Marine arrive on a stretcher at his medical facility, that standard procedures wouldn't work. The Marine had a live rocket-propelled grenade embedded in his body, from his thigh through his buttocks. A surgeon told Lt. Cmdr. Gennari he didn't have to intervene; a bomb squad could remove the grenade.

But Lt. Cmdr. Gennari stepped up to the stretcher, took the Marine's hand and told him, "I promise you, no matter what, I won't leave you until that thing is out of your leg,' " Lt. Cmdr. Gennari says. He administered a sedative so an explosives specialist could pull out the bomb. It was later detonated in a huge blast outside the base. Lt. Cmdr. Gennari kept the Marine alive by pumping a manual respirator during a power failure on a helicopter flight to another camp. He was awarded a Bronze Star for valor this month.

Values that inspire heroism are often taught in childhood; "children who grew up watching their parents stick their necks out for others, are likely to do the same," says Dr. Hupp.

Lt. Cmdr. Gennari says his parents taught him "that every good thing that happens to you is a blessing, and you're supposed to give back." His father Gilbert, a Staff Sergeant in the Army who won a Bronze Star in the Korean War for meritorious service, taught him that "a man's word is a measure of his character," he adds. Thus when he gave the Marine his word that he wouldn't leave him, he says, "that was the way it was going to be."

Write to Sue Shellenbarger at sue.shellenbarger@wsj.com