By Patricia Sellers

(FORTUNE Magazine) – IS IT DUMB LUCK OR SHREWD strategy that ABC has the two hottest new shows on TV? No reasonable industry watcher could have fathomed it last May when Steve McPherson, the latest in a parade of new bosses at ABC Entertainment, delivered a rambling forecast of what the fall would bring. "They clearly lacked a strategy," recalls Laura Caraccioli-Davis, a senior vice president at media-buying giant Starcom Entertainment. McPherson admits, "We honestly didn't have one."

Indeed, credit lucky risk taking for getting ABC back in the running. Desperate Housewives, now the second-most-popular show on television, and Lost helped lift the network, No. 4 last year, to No. 2, at least until the World Series drew viewers to Fox. As ABC rebounds, once-mighty NBC is struggling to stay out of fourth place.

ABC did something right in choosing different and edgy shows this year--smart when your industry's product lineup is so look-alike that reality shows and crime dramas constitute 37.5% of the prime-time schedule. Bleary-eyed viewers want something new. ABC found that in Marc Cherry, a down-on-his-luck writer who just half-jokes when he says he created Housewives "because I thought about the percentage of the population that's made up of forensic scientists and people who work in law enforcement, and I thought perhaps there's a demographic that's being ignored." NBC, CBS, HBO, Fox, and Lifetime, he says, all passed on his sexy, high-gloss soap. "HBO said it wasn't gritty enough for them. CBS said it was too dark," Cherry recalls. Ironically, the ABC execs who greenlighted the shows, Susan Lyne and Lloyd Braun, got booted out when Disney higher-ups became impatient with their track record.

Lost, about plane-crash survivors on a mysterious island, grew out of an idea at a Disney management retreat. Executive producer Damon Lindelof rushed the idea into a finished pilot in three months, and ABC spared no expense--well, actually $12 million--making the first two episodes. To get the plane just right, Lindelof carted a decommissioned L-1011 from the Mojave Desert and barged it to Oahu for the crash scene. Disney CEO Michael Eisner admits that ABC has to make better programs today: "The TV business has become more like the movie business. It's no longer the least objectionable program that wins the day. The excellent program wins the day."

Still, few thought ABC would get people to watch the shows. While other networks had platforms, like NBC's Olympics, to promote their fall shows, ABC had only a sad summer slate. "We took a focused, laser-like approach," says Anne Sweeney, who oversees ABC as well as Disney's nonsports cable networks. She and McPherson directed ABC's marketing budget to three shows (Housewives, Lost, and Wife Swap) and spent like movie promoters, placing ads on bus stops, dropping "I'm Lost ..." messages in 1,000 bottles on beaches, stamping one million dry-cleaning bags with Housewives ads ("Everybody has a little dirty laundry"). But no one expected ads on Disney-owned ESPN and in other sports venues to lift Housewives to No. 3 among men 18 to 49, after ABC's Monday Night Football and CBS's CSI.

Of course, ABC has duds--like The Benefactor, a reality show starring Dallas Mavericks owner Mark Cuban. McPherson and Sweeney expect to finish the 2004-05 season at No. 4--but this may be cautious posturing. "They're being a little modest," says Starcom's Caraccioli-Davis. She calls the new shows coming early next year--including Husband Swap, Boss Swap, and Grey's Anatomy, a medical drama--"a really strong mid-season bench." Marc Berman, editor of Mediaweek's Programming Insider, agrees that ABC will continue its momentum: "The new hit shows are keepers."

How much will ABC's recovery help Disney president Bob Iger, who is competing with outside candidates to succeed Eisner? Iger is blamed for more than $1 billion in operating losses at ABC over three years. What he needs to do is impress the board with a few quarters in the black. -- Patricia Sellers