The home side had taken the lead in the 55th minute when Sweden midfielder Alexander Kacaniklic scored his first goal for the club in over 14 months in his first start since returning from a loan spell at FC Copenhagen.
But Reading were level after 63 minutes as Pavel Pogrebnyak headed in his first league goal of the season against the club he scored six goals for during a 2012 loan spell, but Ruiz had the last word.
The win sees Fulham move eight points clear of the drop zone following a revival under Kit Symons, who has steered them away from relegation trouble since taking over in late October.
But it was Reading who got out of the blocks quicker and they had already had a decent early chance through Alex Pearce’s header before a sixth-minute opportunity fell to Fulham striker Hugo Rodallega.
Ross McCormack found space on the left to cut a pass back to the Colombian, but he could only slice his effort wide of the right post with Reading goalkeeper Adam Federici seemingly beaten.
Reading manager Clark had been critical of his side’s attacking play during the first half of their 0-0 draw at home to Middlesbrough last Saturday but their intent and movement was better here.
Hal Robson-Kanu cut in off the right flank and curled an effort which skimmed the top of the bar before another headed chance fell to Pearce from a corner.
But it was the home side who should have taken the lead just before half-time as defender Shaun Hutchinson’s header from a corner forced a brilliant save from Federici before Rodallega thundered his follow-up effort against the post.
But ten minutes after half-time Fulham had the opening goal as Kacaniklic found space just outside the area to receive a drilled pass from Scott Parker and he took a superb touch to control before steering home a finish that Federici got a touch to but could not keep out.
Reading then pressed for a leveller with Wales striker Simon Cox forcing a good save from the feet of goalkeeper Marcus Bettinelli.
But the visitors’ lead last just eight minutes as Pogrebnyak used his strength to win a header from Oliver Norwood’s corner and draw Fulham level from around eight yards out.
Fulham had looked the more likely to win the game and the man who had replaced their opening goalscorer then headed in from close range after fellow substitute Cauley Woodrow had nodded McCormack’s cross into Ruiz’s path, with the Costa Rican’s fifth goal of the campaign snatching victory at the death.