Bayern Munich have an unenviable task heading into the second leg of their Champions League semifinal. Not only will the holders need to break down a defense that proved themselves extremely resilient a week ago, but while doing so they will have to guard against the most devastating counter-attacking threat in world soccer.

Real Madrid have changed considerably this season under Carlo Ancelotti. In comparison to the days of Jose Mourinho, the team has been much more proactive, focusing on controlling the game through their midfielders, all of whom are more comfortable with the ball than without it. At times the balance has gone too far in an attacking sense, the 4-3 defeat to Barcelona being a prime example.

Given the pace they have going forward, though, the option to go back to a counter-attacking style always looms large. Throughout his decorated coaching career, Ancelotti has shown himself to be unbeholden to any one tactical ideology. The Italian has always looked to adapt based on the players at his disposal and the specific circumstances. This has not always worked out (his Chelsea and Paris Saint-Germain teams often lacked coherency) but it certainly paid dividends last week at the Bernabeu. Against the competition favorites, despite being at home, Ancelotti was happy to cede the ball to their opponents and rely on their threat on the break.

It took some in-game fine-tuning, with Madrid far too passive and much too deep early on, but they achieved a dream result. A lead without conceding an away goal means that Los Blancos can head into the Allianz Arena knowing that they can rely on the frightening pace of their now fully fit duo Cristiano Ronaldo and Gareth Bale. After looking less than sharp in the first leg, Ronaldo was back to his best at the weekend, scoring two sensational goal as Real Madrid brushed aside Osasuna to keep their La Liga title hopes alive. Bale was rested for the fixture after illness, but has been in equally devastating form of late.

Bale’s return to fitness does pose an, admittedly welcome, conundrum for Ancelotti, however. Much of their success in the first leg was in switching to a 4-4-2 and employing an extremely narrow midfield that blunted Bayern’s passing through the middle. Bringing Bale in would threaten that solidity, but would also give them more of chance to get an away goal that would leave Bayern needing to score three.

It is Pep Guardiola, though, who has likely spent far more time in the past few days deliberating over his lineup and approach. While much of the criticism was over the top and almost vitriolic in some circles, it is hard to dispute that Guardiola got things wrong in the first leg. The decision that backfired most obviously was having the best full-back in the world at the base of midfield, rather than defending against Madrid’s strengths down the flanks. It was down the side that Lahm would have been occupying that Madrid created their only goal and from where they set up two more glorious chances that could have put them three goals to the good before half-time.

If Ronaldo is switched back to the left in a 4-3-3 the there is even more reason for Lahm to be switched back to what was his default role before this season. His inclusion in that role would not merely be for defensive purposes. At full-back, Lahm also provides a valuable extra attacking threat. When Guardiola finally made the change midway through the second half at the Bernabeu, Bayern had plenty of late joy down that flank with Lahm testing out a struggling Isco. Regardless of whether Isco plays down that side again in a four man midfield, or Di Maria is there in a three, and whether it is Fabio Coentrao or Marcelo at left-back, it is that side where Madrid are most vulnerable.

If Guardiola needed another reminder about how valuable Lahm can be out wide, he provided it on Saturday when coming on at half-time and playing a major role in turning a 2-1 deficit into a 5-2 win over Werder Bremen, getting an assist in the process. If Madrid are to look to pack the center again, then the width that Lahm provides, while allowing Arjen Robben greater freedom to cut inside, could be vital.

The other change that made a big difference in the first leg was the introduction of Thomas Muller. He may not be the most refined of players, but his effectiveness is almost unmatched in the world game. His ability to get into the box and find space as well as offer an aerial presence will provide a Madrid defense, which was all too comfortable for much of the first leg, a different problem.

Of course, as well as personnel changes, Guardiola is counting on a much improved performance from Franck Ribery. The man voted the world’s third best player earlier this year was anonymous in the first leg. But having performed much better and gotten a goal against Bremen, Guardiola believes the France international has regained what makes him tick.

"He was playing angry against Bremen [in Bayern's 5-2 win on Saturday],” he said, according to The Guardian. “Franck needs this aggression, he needs to play angry. He keeps fighting and that is why fans love him. He is one of the best players in Bayern history, he has always performed at the highest level and we need the best Ribery.”

There is reason then to believe that Bayern can get the two goals needed to progress to what would be an extraordinary fourth final in five years and stay on course to become the first team to retain the European Cup in the Champions League era.

Yet, there is also every indication that Madrid will get an away goal. Bayern again showed their vulnerability to fast-paced counters against Bremen and, having kept a clean sheet just twice in their last 15 fixtures, it is difficult to imagine them keeping Madrid’s multitude of threats at bay for the entire 90 minutes. The Spanish giants should score and it will be a case of whether Bayern can then find the three goals they need. It is far from beyond them, but it will be a huge task.

Prediction: Bayern Munich 2-1 Real Madrid