The Bavarians have already sewn up the league title this year, meaning they can go into the first leg of their semi-final with the Spanish giants at the Allianz Arena on Tuesday without looking over their shoulders.
Lars Stindl's 16th-minute own goal gave the visitors the lead, while Ribery netted midway through the half, with Mario Gomez then striking either side of half-time.
Claudio Pizarro netted in the 71st and 86th minutes, with Andre Hoffmann grabbing a consolation for the overwhelmed hosts in between times.
Borussia Dortmund remain 20 points behind Bayern and eight ahead of third-placed Bayer Leverkusen following a comfortable 2-0 victory over Mainz.
Dortmund welcome Real Madrid in the other Champions League last four encounter and they will also be buoyed with a comfortable win.
Marco Reus opened the scoring in the first minute before Robert Lewandowski sealed Dortmund's success three minutes from time.
Meanwhile Leverkusen took full advantage of Eugen Polanski's dismissal to rout Hoffenheim 5-0.
The hosts were already ahead thanks to Stefan Kiessling's 16th-minute strike before Polanski saw red midway through the half, with Andre Schurrle putting Leverkusen two goals to the good before half-time.
Further strikes from Kiessling (65) and Schurrle (69) added to Hoffenheim's misery, while Stefan Reinartz added gloss to the scoreline.
Fourth-placed Schalke's position is looking increasingly shaky following a 1-0 defeat at Eintracht Frankfurt.
Marco Russ' 41st-minute goal helped the hosts move to within one point of Schalke, who could find themselves in fifth if Freiburg win at Stuttgart on Sunday.
Fortuna Dusseldorf missed out on the opportunity to move further away from the drop zone after a 2-1 loss at Hamburg.
Rafael van der Vaart netted in the 14th and 20th minutes to put Hamburg in the driving seat and although Dani Schahin - a 17th minute substitute for Genki Omae - halved the deficit just after the half hour, Dusseldorf could not find a leveller and they remain just three points clear of the bottom three.
First-half strikes from Maximilian Arnold (13) and Ivica Olic (27) plus midfielder Diego's 66th-minute penalty sealed an emphatic 3-0 triumph for Wolfsburg at Werder Bremen.