Same-sex sells. At least the companies behind a wave of gay-themed advertising hope so.

Chains such as J.C. Penney and Gap are cultivating an inclusive vibe with new ads depicting gay couples, but they’re doing the math first: How many customers will they win vs. how many will they alienate? President Barack Obama worked a similar equation in declaring his support of same-sex marriage, according to pundits.

“I can't imagine large companies like J.C. Penney and the Gap would make big investments without doing their homework and due diligence for it to make sense," said Karen Post, the author of "Brand Turnaround.”

J.C. Penney incurred the wrath of a conservative group by showing lesbians with wedding rings and their children in a Mother’s Day catalog. The caption declared, "You'll often find Wendi, her partner, Maggie, and daughters elbow-deep in paint, clay or mosaics." One Million Moms accused the retailer of taking the wrong side in a culture war.

Now Gap has released a campaign featuring two young men cuddling inside the same T-shirt, accompanied by the caption "Be One." The billboards and bus sides feature a real-life couple: Tony-nominated actor and gay activist Rory O'Malley and his boyfriend, Gerold Schroeder.

Weeks earlier, Ray-Ban unveiled its "Never Hide" campaign with two men holding hands. Even Urban Outfitters, whose CEO, Richard Hayne, donated more than $13,000 to conservative Rick Santorum’s presidential nomination bid, got into the act. Two women kiss on the mouth in a catalog entry. Cue the One Million Moms response.

The controversial ads arrive amid a storm of activity on the gay-rights front. North Carolina voters banned same-sex marriage and then Obama came out in favor of it. Coupled with a second One Million Moms' protest of J.C. Penney -- the group initially criticized the retailer's hiring of openly gay Ellen DeGeneres as a pitchwoman and called for a boycott -- such news has created a more electric platform for launching any new gay-friendly brand message, analysts said.

Ads featuring gay characters are not entirely new. Big-name brands such as McDonald's France, Heinz and Levi's have all gone there. Heinz withdrew its ad, in which two dads kiss, because of complaints to the Advertising Standards Authority in the United Kingdom. Even Doritos winked at the concept in a Super Bowl commercial.

But advertisers following in their footsteps are even more willing to preach tolerance because it seems to make better business sense.

"They're trying to create a modern representation of families,” said Mary Ellen Muckerman, the strategy director of the branding firm Wolff Olins. "This reflects [the values of] a bigger, more mainstream audience than one might believe."

Both J.C. Penney and Gap released their ads with little or no fanfare. And both have been careful in their wording since. "It's about celebrating what makes people unique through the lens of a T-shirt," said Gap spokeswoman Liz Nunan. J.C. Penney spokeswoman Kate Coultas wrote in an email, "We want to be a store for all Americans."

Gap's taking a side in a hotly debated issue should come as no surprise. In 2010, the San Francisco-based chain put together a video featuring Gap employees sharing their experiences with bullying, aimed at inspiring struggling gay teens.

But analysts believe J.C. Penney, which has fought a dowdy image for decades, is taking a huge leap under new CEO Ron Johnson, the former Apple and Target executive.

"They became bold and they became controversial, and I think both of those things helped tremendously," said Liz Goodgold of Redfire Branding. "Boring doesn't work. Vanilla doesn't sell."

J.C. Penney's spokeswoman emphasized that the catalog page was not part of any campaign and declined further comment.

Taking the high road and inviting customers to do the same could give CEO Johnson an early victory in reworking the JCP brand, said Peter Shankman, founder of the Geek Factory marketing boutique. "They know exactly what they're doing but they're not going to rub in it anyone's face consciously."

The backlash of groups such as One Million Moms appears to multiply the goodwill. Every protest has ticked up J.C. Penney's score on the YouGov BrandIndex, which measures customer satisfaction and general impression.

But while J.C. Penney has taken a leap toward progressive, its stock price has struggled. In early February, when DeGeneres' hiring became public, J.C. Penney's stock sold for $41.42 a share. The stock closed at $34.33 on Friday. In a March 24 report, Zacks Investment Research gave the company a neutral recommendation despite Penney's measures that included the new "fair and square" pricing strategy.

J.C. Penney will announce its first quarter earnings on Monday. Meanwhile, rival Macy's crowed to shareholders this past week that it would continue to eat at Penney's market share after Macy’s profits rose 38 percent in the first quarter.

One marketing strategist felt Penney’s had not solidified its identity to hook new customers. "Penney's management and advisors are resorting to tactical Hail Mary's, pandering to the popular fads and whims, hoping they'll attract brief attention," emailed marketing strategist Rob Frankel of the Frankel and Anderson agency.

But according to many experts, advertisers better recognize a recent poll indicating that half of the country approves of gay marriage. Those that already do get one humongous demographic to themelves.

Said Muckerman: “What they're doing reflects what this audience believes in."

Alice Hines contributed reporting.