Yates moved up to third place overall as Dan Martin won the stage.
Yates recovered from the problems he showed on Monday as he attacked Bernal on the steep gradients of the climb to Sega di Ala, taking 53 seconds out of the Colombian by the summit to spring back in to the podium places.
Yates crossed the line third on the day, 30 seconds after Martin, who took his first Giro stage win to complete his Grand Tour set as reward for a long day in a breakaway on the 193km run from Canazei.
Yates had looked down and out after he lost more than two minutes on Monday to drop from second to fifth, while Bernal had not put a foot wrong in the race to this point – and had celebrated a fine stage victory 48 hours earlier.
But things looked very different after Tuesday’s rest day as Yates attacked four kilometres from the summit. Bernal initially followed but within a kilometre he was struggling to hold the wheel of Ineos Grenadiers team-mate Dani Martinez as Yates skipped away.
With second-placed Damiano Caruso also struggling, the damage to Bernal’s overall lead – now two minutes and 21 seconds – was limited to just three seconds, but it remains to be seen if this was a sign of things to come or a temporary blip after the rest day.
“Today was a tough day for me for sure,” Bernal said. “The last kilometres were really steep. I tried to follow Yates but today he was stronger than me. I just tried to arrive with Caruso who is closest in the GC. I don’t want to take any risks.
“For sure Yates was very impressive and I just did my best. I’m happy because I didn’t lose too much time.”
Team BikeExchange’s Yates now sits in third, three minutes and 23 seconds back, overhauling Aleksandr Vlasov and Hugh Carthy, who both slipped back and are now more than six minutes down in fourth and fifth respectively.
“I didn’t know the situation,” Yates said of his attack. “I didn’t know he was dropped until a bit later. I was going full gas so it’s not like I could accelerate to increase the gap.
“I just hope the weather stays like this. Every day it has rained I’ve not had a good day so hopefully it stays the same and we’ll see what I can do.”
Martin, racing the Giro for the first time since he crashed out in the opening team time trial in Belfast back in 2014, had seen his own hopes of pink effectively ended on the gravel roads of stage 11.
But he rescued his race in some style here as he hit the climb with an advantage of around 90 seconds and held on ahead of the fireworks behind.
“I think the shake of the head at the end there said I couldn’t quite believe it was happening,” the Israel Start-Up Nation rider said.
“That’s what I came here for, to try to win a stage and I knew today was one of the last opportunities. With the time I lost it was possible to go in the breakaway and to do it was incredible.”