You may apply at Immigration Office (Airport). Just get the form for Return Visa filled in arabic then attached your wife's passport copy & RP and also your QID then pay QR500. They should be able to enter Qatar before their RP expires.
The was the process I had made this morning at it was approved.