A variety of programming, highlighted by Saturday’s coverage of the Preakness Stakes, helped NBC to a strong ratings perf over the weekend.

The Peacock’s sports division generated a 7.9 overnight Nielsen household rating/18 share for the early-evening broadcast of the Preakness (6-6:45 p.m. ET), in which Rachel Alexandra became the first filly in 85 years to win the race.

Rating was the best for the Preakness since 2004 and the second highest in nearly two decades. NBC has effectively broadened the reach of the sport with its promotional efforts, also having delivered the top-rated Kentucky Derby in 20 years earlier this month.

Later that night, NBC’s “Saturday Night Live” wrapped its 34th season by matching its highest-rated finale in four years. The telecast, hosted by Will Ferrell and featuring musical guest Green Day, averaged an overnight 5.4 household rating/14 share, according to Nielsen — matching last year’s delivery for the finale, which featured Steve Carell, Usher and a special appearance by Sen. John McCain.

The last time an “SNL” finale fared better was the 2005 season-ender (6.2/15 for Lindsay Lohan and Coldplay).

NBC also shined on Friday, with its two-hour documentary “Farrah’s Story” standing as the night’s top program (prelim 2.4/8 in 18-49, 8.9 million viewers overall). The spec chronicled Farrah Fawcett’s 2½-year battle with cancer using footage shot on her own homevideo recorder.

The 2.4 demo rating repped a big 60% improvement over NBC’s prior four-week average in the 9-11 p.m. Friday timeslot (1.5).

On Thursday, ABC’s two-hour “Grey’s Anatomy” season finale averaged a hearty 5.9 rating/16 share in adults 18-49 and 16.53 million viewers overall — the show’s best demo score since mid-February and its largest overall audience since its season preem last September.

The big showing seemed to sock the season finales of NBC’s “The Office” (3.5/9 in 18-49, 6.77m) and CBS’ “CSI” (3.4/9, 14.81m), with the latter producing its lowest firstrun score to date.

Sports may have impacted some of the more male-skewing Thursday series, as Game 6 of the NBA Playoff series between the Los Angeles Lakers and Houston Rockets (9:51 p.m.-12:35 a.m. ET) became the most-watched basketball telecast ever on ESPN (7.35 million viewers). The previous record was 6.6 million for Game 6 of the Eastern Conference finals in 2006 (Miami-Detroit).

Also, the Boston-Orlando NBA playoff game earlier Thursday (7-9:51 p.m. ET) averaged a solid 4.80 million viewers.