The 26-year-old, who spent seven years playing for Manchester United before joining Lyon in 2015, made just 18 Ligue 1 starts last season after suffering a hamstring injury.
Instead of pocketing his salary while on the treatment table, the Brazilian opted to donate the cash to his club's charity the OL Foundation.
Rafael's money helped buy a robot, which allowed children in hospital to speak to the footballers ahead of matches.
"I like to play and I like to be paid for doing that, but I wasn't playing," L'Equipe quotes Rafael as saying. "I'm happy to have done that for the kids, but it was good for me too. It helped me."
Lyon are currently eighth in the league table.