Prime-time TV is going gray.

After decades chasing young viewers, the broadcast networks are starting to shift tactics - peppering their lineups with shows and actors who appeal to the growing audience of aging baby boomers.

“The Millers” on CBS features 72-year-old Beau Bridges and Margo Martindale, 62. NBC has James Spader, 54, in “The Blacklist” and is considering a new family sitcom with Bill Cosby, 76. ABC, stuck in last place, is developing a show about basketball buddies in their 60s.

The trend is being driven by demographics. Members of the baby boom generation will all be 50 or older this year, and they watch a disproportionate amount of TV.

The median age of a broadcast television viewer is now the highest ever at 54. Twenty years ago, it was 41. The most-watched scripted series in the 1993-94 season was “Home Improvement,” with a median viewer age of 34. Today, it’s “NCIS,” with a median viewer who is 61.

Confronted with these realities, the networks are aggressively making the case to advertisers that older viewers are valuable - especially the affluent and influential 55-to-64-year-olds they’re calling “alpha boomers.” The 50-and-up crowd of today, they contend, is far different than the frugal and brand-loyal group that came of age during the Great Depression and World War II.

“These people are more active, healthier and much more likely to still be in the workforce,” said David Poltrack, chief research officer at CBS. “It’s certainly a much more vibrant and economically active audience than it used to be.”

Ironically, it was the baby boomers who first led TV networks to cater to younger viewers in the 1960s.

Until then, network ad rates were based simply on the number of households watching. But as the first wave of Americans born after World War II entered adulthood, third-place network ABC saw an opportunity to promote this audience as super consumers, and pushed for advertisers to focus on viewers younger than 50.

By the 1970s, ABC was booming with youth-oriented hits such as “Charlie’s Angels” and “Happy Days.”

Now CBS, NBC and ABC are pointing to research that shows consumers over 50 spend some $90 billion a year on cars alone. By 2017 they will control 70 percent of the nation’s disposable income.

“Boomers have been marketed to since they were 5, because they were the first generation raised in front of the TV,” said Matt Thornhill, founder of the marketing think tank the Boomer Project.

In contrast, their children, known variously as millennials, Gen Y or echo boomers, are living at home longer and making fewer key purchasing decisions than their predecessors.

In theory, that should make them less attractive to advertisers. But in reality, they are more prized than ever.

Younger adults, busy with school, careers, socializing and child-rearing, have always watched less TV. Now they’re even harder to find, thanks to technology that allows them to watch TV whenever and wherever they want, and to skip over commercials.

Since these viewers are so elusive, advertisers will pay more to reach them.

“Television naturally skews older, and that’s why advertisers have historically paid a premium for a younger audience,” said Neil Ascher, managing director of Zenith Optimedia, which advises companies that buy TV advertising.

Network ad sales executives are working to change those calibrations, but it’s hard to quantify their success. Buying time on network television is a complicated series of negotiations, and there is no industry-wide rate standard.

A decade ago, networks primarily sold ad inventory for prime-time shows based on how many 18-to-49-year-olds were watching at home. Now, network sales teams are emphasizing other metrics, such as income and education level of viewers.

For example, ads on CBS’ “The Good Wife,” ABC’s “Modern Family,” and NBC’s “Parks and Recreation” command a premium because they draw more affluent viewers, industry experts say.

“Everyone over 50 has essentially been given away for free to advertisers,” said Jack MacKenzie, president of Magid Generational Strategies, a consulting firm that advises Fortune 500 companies. “What we’re telling our media clients is you’ve got to find a way not to give them away anymore.”

Executives at NBC, CBS and ABC are especially keen on the tech-savvy alpha boomers, according to Alan Wurtzel, president of research and media development at NBC Universal.

As consumers, they spend considerably more on home improvement, credit cards, travel and beauty products than do younger cohorts. Their image-consciousness makes them ideal consumers, said Wurtzel: “If alpha boomers aren’t vain, I don’t know who is.”

The major broadcast networks aren’t the first to figure out there’s money to be made off boomers: On cable, there are a growing number of networks eager to attract their eyeballs - TV Land, Encore Classic, RLTV and MeTV.

This combination of factors has led to an increase in the numbers and prominence of older actors on TV.

This fall, CBS recruited Robin Williams, 62, for a new sitcom, “The Crazy Ones.” Another TV star of yesteryear, 66-year-old Ted Danson, joined the cast of “CSI” in 2011. Other big names at the network are Tom Selleck, 69, of “Blue Bloods,” and Mark Harmon, 62, of “NCIS.” Next season, they may be joined by Scott Bakula, 59, in a New Orleans-set “NCIS” spinoff that just received a pilot order at CBS.

Even Fox, with the youngest-skewing audience, has gotten into the act - bringing jazz crooner Harry Connick Jr., a 46-year-old favorite of moms the world over, in as a judge on “American Idol.”

Many of these shows follow a multigenerational model: A man in his 50s or 60s with a female following, surrounded by a younger, eye-pleasing ensemble.

(EDITORS: STORY CAN END HERE)

CBS has historically skewed older than its rivals and has pushed back most forcefully against industry orthodoxy that prizes youth above all. With its more traditional lineup of crime dramas and middle-of-the-road sitcoms, CBS continues to have the oldest audience in broadcast TV, with a median viewer of 58 this season.

And for nearly all of the past decade, CBS has ranked as the country’s most-watched network. In a rapidly shifting media environment, this stability alone is appealing to advertisers, even if the network’s more mature fan base isn’t.

In the 2012-13 season, CBS drew such big numbers across the board that it also finished first in total viewers 18 to 49 for the first time in 21 years.

“We’ve always had a broad-based programming strategy,” said Nina Tassler, chairman of CBS Entertainment. “You can’t have a monster hit without getting all demos.”

In the 2010-11 season, there were just two prime-time broadcast shows (out of the more than 70 non-sports programs on the four major networks) with a median viewer age 60 or older; this year, there are 10. (All are on CBS, with the exception of “Dancing With the Stars.”)

Across the networks, there are also more shows strategically designed to appeal to viewers both young and old - think multigenerational family sitcoms such as “Dads” or “Mom,” or dramas like “The Blacklist” that combine elements of the classic crime or medical procedural shows with those of serials that evolve from week to week.

After years in the ratings basement, this season NBC struck gold with the Dec. 5 broadcast of “The Sound of Music Live!,” which drew 18.6 million viewers. The live televised musical, a revival of a format not seen on the small screen since the Eisenhower era, was explicitly designed as a throwback, and attracted a median viewer of 55. And yet in the all-important demo, it finished just a hair behind “The Big Bang Theory,” the No. 1 scripted broadcast show with viewers under 50.

Less than two years ago, the same network canceled one of its most-watched programs, “Harry’s Law,” because as NBC Entertainment Chairman Bob Greenblatt put it at the time, “Its audience skewed very old and it is hard to monetize that.”

“People’s jaws dropped,” recalled series lead Kathy Bates, 65. “Geez Louise, who do you think watches TV out there, bud? The advertisers have got to wake up to this. Who do you think’s got the money out there?”