Two women in their late 20s walk into a Manhattan bar. One, an energetic blonde named Jayne, is the cofounder of a financial technology start-up. Her friend, Tina, is a computer programmer with a tattoo and an Ivy League degree. Both single, they instinctively know not to talk about their jobs with any men who approach them. “Guys shut down,” Tina says.

Ask a straight man if he’s attracted to smart women and in all likelihood he’ll say yes. Ask him if he’d go for someone smarter than he is and, again, he’d likely say yes, as was discovered in a recent study led by psychologist Lora Park at the State University of New York at Buffalo. When male volunteers were told that a hypothetical female classmate outscored them on a math or verbal test, the majority said they would prefer her as a romantic partner over a woman with a lower score.

Sounds enlightened. But Park and her colleagues—psychologist Paul Eastwick and Ariana Young, a doctoral student—pressed on. They asked their subjects to take a math test, then manipulated each man’s result to make it higher or lower than that of an actual woman sitting next to him. When the man’s score was higher than the woman’s, he was more likely to put his seat nearer to her and express romantic interest. But when his score was lower than hers, the study showed, he was likely to feel less attracted to her, less masculine himself, and less interested in getting her contact information or going on a date with her. He also set his chair farther away from her.

Park is quick to clarify that previous research has shown that men are attracted to female ; in fact, it’s one of the strongest predictors of romantic interest. It’s when men have the sense of being outperformed, she says, that “things get tricky in real life.” The finding jibes with previous research, including a Columbia University speed- experiment in which single guys valued female smarts—but only up to a point. If a woman they met seemed smarter or more ambitious than they believed themselves to be, they dialed down their romantic interest.

If such a pair actually go out, the man’s mindset isn’t guaranteed to be very different. Kate Ratliff, a psychologist at the University of Florida, led a recent study in which men in a dating relationship were asked to reflect on a time when their partner was successful in an intellectual or academic domain. The task led to a drop in men’s implicit , as did news that their girlfriend outscored them on a social-intelligence test. “It’s more of a gut reaction of negativity, not a thought-out response,” Ratliff explains. “Without realizing it, men reframe ‘Wow, my partner is successful’ as ‘Wow, my partner is successful and I am unsuccessful.’”

The blow to the ego, however self-inflicted, appears to hurt how men see their relationship. In Ratliff’s study, they distanced themselves from their partner and were less about their future together. Asked to reflect on a girlfriend’s failures, however, their self-esteem increased, as did their perceived odds of being together in the longterm. (Female self-esteem, meanwhile, was unaffected by a partner’s success.)

Not every fellow has the of actor George Clooney, who calls his wife Amal, an accomplished international lawyer, his intellectual superior and himself her “arm candy.” Men often feel they need to defend their status as competent and competitive, Park explains, and being outperformed is a threat. We can attribute this to traditional roles, biology, and evolutionary biases that favor and rivalry. If nothing overrides a man’s feeling of inadequacy, he can become and and suffer from low self-esteem. He might that a woman who outperforms him is out of his league, or that she’ll leave him for a sharper go-getter.

If a man reacts negatively to the perceived superiority of a woman, he’s probably unaware of it. “People are not very good at introspecting and reporting why they do what they do,” Park says. If she had asked any of her subjects why he wasn’t romantically interested in the woman who outscored him, chances are he would come up with reasons unrelated to her smarts. He might reframe the woman’s intelligence—a trait he claimed to value dearly—in an unflattering light, casting her as cold, pretentious, or a cookie-cutter know-it-all, when, in fact, his ego was threatened. If any of us could access our , we’d see that we pick partners and stay with them based not on lofty, abstract ideals, but on how they make us feel.

The hopeful news is that men can feel great—even when a female partner outperforms them—if they view the relationship itself as an emotional resource. A study based at the University of Toronto used the familiar setup in which men (and women) are told that their real-life significant other scored higher on an intelligence test. This time, they had to rate their degree of closeness to their partner beforehand, as well as afterward, which made them reflect on the warmth and affection they felt for each other. For those who were close to their lovers, the news of that person’s superior test results appeared to actually activate feelings of connectedness and an affirmation of the relationship’s value. The result: Male self-esteem remained intact.

“The more the male partner can focus his thoughts on the ‘team’ aspect of the relationship, the better he copes,” says Rebecca Pinkus, a psychologist at Western Sydney University who researches strategies that couples use to overcome divisive comparison. He could achieve this, she says, by taking pride in his partner’s abilities and being happy for her successes—an attitude known as the “ response.” He could think of their skills as complementary: “She excels in domain A, whereas I excel in domain B.” Or he could focus on how his partner’s intelligence might benefit him or their life together in a variety of ways, like a better job that boosts them financially. The bottom line, Pinkus , is the perception of a shared fate, an overlapping of identities, a sense of “we.”

But how does a brainy woman get from “me” to “we”? A better strategy than propping up male self-esteem by hiding her own intellect, Park suggests, is finding a man who’s supportive of a prospective mate’s intelligence and ambition from the start. A woman has more options if she’s willing to override romantic scripts that encourage her to underplay her strengths and make men think they’re smarter than she.

As for single guys, there’s a little-known benefit for those who genuinely prefer women who are smarter than they are. Park’s latest research found that these men, once primed with romantic thoughts, actually perform better than they otherwise would on science and math tests. Motivated to impress an impressive woman, some men rise to the occasion.

Facebook image: bbernard/Shutterstock