The centre-back collided with team-mate Toni Kroos during the second half of the Bernabeu stalemate on Saturday afternoon.
After being taken to hospital for a scan, the Portuguese was ruled out of both legs of the tie against the Bundesliga champions.
A statement from the club read: “After the examinations carried out today on Pepe at the Sanitas La Moraleja University Hospital, he has been diagnosed with fractures in seventh and eighth ribs on the left side.”
With Rapahael Varane out with a hamstring problem, Real boss Zinedine Zidane has problems at the back going into next week’s first-leg.
Nacho and Sergio Ramos are the only two first-team centre-backs available for the Frenchman, as Real get set to face a Bayern side that hit four goals past Borussia Dortmund earlier on Saturday afternoon.
Pepe scored the opening goal against Atletico, only for it to be cancelled out by a late Antoine Greizmann strike which dealt a blow to their title hopes.
Pepe’s contract at Real Madrid expires at the end of the season, meaning he may have played his final game for the side, should the injury be a season-ender.