The 32-year-old joined the League Two side on a month-long loan switch in November.
Manager Aidy Boothroyd has admitted that he is pleased to extend Ravenhill's spell with the Cobblers.
"I think he's the kind of guy that glues a team together," he told BBC Sport.
"Ricky has been there and done it. He's won promotions before and he knows what this league is all about. We're delighted to have got him at such a crucial time."
Ravenhill has made six starts for Northampton.