Directed by Paul Feig ("Bridesmaids") from a script by "Parks and Recreation" writer Katie Dippold, "The Heat" pairs Bullock as Sarah Ashburn, an uptight FBI agent in ill-fitting suits, with McCarthy as Shannon Mullins, a brusque Boston cop who dresses like a 1980s lady rapper. Instead of romantic pining, the story's emotional undercurrent comes from the loneliness of women who are very good at their jobs.

"It wasn't a movie written for two guys," Feig said. "It was funny in a way women are funny and touched on themes of female friendship, professional women in the workplace who have chosen career over family and kids."

On-screen, Bullock and McCarthy play goofy but capable everywomen, and in a joint interview, they slipped easily into their public personae, sharing photos of their young children, bickering about texts — "You don't answer, that's just a fact," Bullock said. "I'm better at texting than anything else I do," McCarthy responded — and assessing how much teasing a reporter could withstand. "I bet we could push you pretty far," Bullock said, with a twinkle.

Were it not for the presence of enough publicists behind the hotel room door to launch a presidential campaign, it would be easy to forget that these are two of the most powerful women in Hollywood, with the ability to get movies greenlighted and to approve their directors and costars. Once they attached themselves to "The Heat," the project went from script to shooting in a matter of weeks — an accelerated progression in a town where even favored scripts linger in development for years.

That both women are older than 40 — a demographic Hollywood typically ignores — and that McCarthy's body doesn't conform to Size 0 industry norms makes their shared success that much more unusual.

Bullock, 48, and McCarthy, 42, have both risen on that ineffable quality that creates movie stars and sometimes presidents — they seem like they'd be fun to get a beer with. Bullock, the Virginia-born daughter of a Pentagon contractor and an opera singer, came up in the '90s, propelled by a tomboyish charm in movies such as "Speed" and "Miss Congeniality" before winning an Oscar for playing the brassy Southern mother in 2009's "The Blind Side."

McCarthy, raised on a farm in Illinois, performed in the L.A.-based improv comedy group the Goundlings and has appeared on TV shows such as "Gilmore Girls" and her current program "Mike & Molly" but is a more recently minted star on the big screen. She emerged in a breakout role as a rambunctious and occasionally lewd member of a wedding party in 2011's "Bridesmaids" and solidified her status this year as a star who can open a movie by playing a crook who plagues Jason Bateman's character in the surprise hit "Identity Thief."

For Bullock, the increasingly prominent role of women in big-screen comedies is a heartening change from when she emerged in Hollywood 20 years ago. Much of that change she attributes to the rise of writer-performers such as Dippold and McCarthy, who is shooting and starring in a comedy for Warner Bros called "Tammy," which she co-wrote with her husband, actor Ben Falcone.

"It does still feel Wild Westish. Carol Burnett was doing all her writing. You had those iconic women who did it, but they were the exception," Bullock said. "I hope one day we don't say 'Women in comedy,' 'Men and comedy,' they just go 'Who was in it?'"

Chemistry factor

The actresses had never met until Bullock called McCarthy in her trailer on the "Identity Thief" set to see whether she was interested in playing Mullins. As in any screen pairing, chemistry would be critical — "The Heat" calls for their characters to evolve from elbow-flinging rivals to glass-clinking buddies over less than two hours.

"You have to instantly bond, instantly create a relationship in this weird world that we're in," Bullock said.

"She was game for anything," McCarthy said. "It was fun to poke and jab at her."

"We had a safe word," Bullock said: "Peaches."