KEVIN BACON and KYRA SEDGWICK took a major financial hit when when Bernie Madoff investment scandal blew up, but thanks to Kyra, the family is back in the black!

Not only did the Emmy-win­ning actress keep the money rolling in with her role on “The Closer,” she encouraged her movie-star husband to switch to the little screen for the new FOX smash hit “The Following.”

“For years, Kevin had turned up his nose at the idea of doing television,” an insider told The ENQUIRER. “But after Kyra started doing ‘The Closer,’ she convinced him that there were a lot of worthwhile TV projects out there and that he should give it a shot.”

The source said that  Kyra knew “The Following” was right up Kevin’s alley as soon as she saw the script.

“Kyra told Kevin, ‘This is the one for you! It’s perfect!’”

“The Following” is a blood-curdling thriller in which Bacon plays former FBI agent Ryan Hardy, who captured notorious serial killer Joe Carroll (James Purefoy) years ago. Carroll develops a cult following behind bars then escapes from death row, and Hardy is called back into action to hunt down the lunatic and his twisted band of copycat killers.

Bacon, 54, who married Sedgwick, 47, in 1988, told the source: “Kyra was right. The show is great! It’s put me back on the map as an actor.”

It also put some bucks in his pocket after Kevin and Kyra lost “millions” in Madoff’s infamous Ponzi scheme, which cost investors $50 billion and earned the 74-year-old scam artist a 150-year prison term.

“Kyra singlehandedly guided their family through some pretty dark days,” said the source. “She kept the money coming in with her show, and now Kevin is raking it in again with a series that’s bound to have a long run.”