(Health.com) -- Humans are hardwired to feel another person's pain. But they may feel less innate empathy if the other person's skin color doesn't match their own, a new study suggests.

When people say "I feel your pain," they usually just mean that they understand what you're going through. But neuroscientists have discovered that we literally feel each other's pain (sort of).

If you see -- or even just think of -- a person who gets whacked in the foot, for instance, your nervous system responds as if you yourself had been hit in the same spot, even though you don't perceive the pain physically.

Researchers in Italy are reporting that subtle racial bias can interfere with this process -- a finding with important implications for health care as well as social harmony.

Complete coverage: Black or white -- Kids on race

"Pain empathy is basically feeling someone else's pain," says Carmen Green, M.D., a professor of anesthesiology at the University of Michigan, in Ann Arbor, who was not involved in the research. "This paper tells us that race plays a role in pain empathy."

In the study, which appears in the journal Current Biology, people of Italian and African descent watched short film clips that showed needles pricking black- and white-skinned hands. As they watched, researchers measured the participants' empathy (i.e., their nervous-system activity) by monitoring sensors attached to the same spot on their hands. They also tracked the participants' heart rates and sweat-gland activity, a common measure of emotional response.

Readers: Children learn attitudes about race at home

"White observers reacted more to the pain of white than black models, and black observers reacted more to the pain of black than white models," says the lead researcher, Alessio Avenanti, Ph.D., an assistant professor of psychology at the University of Bologna.

The researchers also showed clips of a needle pricking a hand painted bright purple. Both the Italian and African participants were more likely to empathize with this intentionally strange-looking hand than with the hand of another race, which implies that the earlier lack of empathy was due to skin color, not just difference. "This is quite important, because it suggests that humans tend to empathize by default unless prejudice is at play," says Avenanti.

The researchers gauged prejudice by testing the participants on how readily they associated good and bad concepts with Italians and Africans. The people who showed a strong preference for their own group in this test also tended to show the least empathy when the hand belonging to the other group was needled, the researchers found.

Although the culture and history of racial bias is somewhat different in Italy than in the U.S., Avenanti suspects the findings would be similar if the same experiment were conducted with Americans.

Empathy is more complex in the real world than in a laboratory. Even so, the study findings suggest that racial differences and prejudice could play a role in some doctor-patient interactions, especially in the treatment of pain or chronic pain.

Health.com: What to do when you disagree with your doctor

"A doctor with high racial bias may understand the pain of other-race patients in a more detached or disembodied manner and, in principle, this may contribute to the causes of racial disparities in health care," Avenanti says.

Previous research has shown that doctors tend to empathize more with a patient's pain -- and provide higher-quality care -- if they have a history of pain themselves, or if someone close to them has experienced chronic, debilitating pain, Dr. Green says.

"Now we are understanding that if you see someone as being more like you, you can empathize with their pain better," she says. "Race, age, gender, and class probably play a role in how we assess and treat patients with pain."

So does that mean that, say, an African American with low back pain should seek out only doctors who are African American?

Health.com: 10 products that help ease pain

Not necessarily. Green says it's more important to find a doctor who actively listens to you and asks questions.

"If you feel you are not heard, or that your pain complaints are not being taken seriously, you can and should see another doctor," she says.