On a day of intense cold and rain, when temperatures plummeted to a few degrees above zero on the highest climbs, Nibali attacked his main rivals on the final seven-kilometre ascent of the Collada de la Gallina.
Joined by American Chris Horner, Nibali crossed the line in second place 3 minutes and 55 seconds behind lone breakaway Ratto, with Horner third.
"I haven't won yet, but this is an important step forward," Nibali, the winner of the Giro d'Italia this spring, told reporters afterwards.
"It was a very hard day, a lot of riders suffered badly on the descents because it was so cold.
"Horner is very strong and I'll have to watch him, but we're weeding out the rivals and we've done a lot of damage overall."
Horner's team-mate, Croatian Robert Kiserlovski, upped the pace dramatically in the front group of favourites on the final climb, preparing the ground for the American to attack.
But Nibali was able to stay with the American and even drop him close to the finish to snatch a few more seconds' advantage.
"I had no reason to attack Horner, we had gained time on our Spanish rivals," Nibali said, before sending a message of support to double Giro d'Italia winner Ivan Basso of Italy, who abandoned because of hypothermia on the stage.
Valverde lost nearly 50 seconds after he was dropped on the descent of the Ordino, the second climb of four, and nearly fainted because of the cold.
"It was inhuman, the hardest day I've ever had on the bike," Valverde said.
"If this goes on there will only be 50 riders in the race."
Stage winner Ratto attacked his fellow breakaways 60 kilometres from the finish to claim his first Grand Tour victory at 23.
"It's very strange to win here, I'm a sprinter, not a climber," Ratto told reporters afterwards, "but I'm lucky, I live in the mountains, so cold, rainy days like these suit me fine."
The Tour of Spain finishes in Madrid on September 15th.
Results from Vuelta a Espana (Baga - Collada de la Galina, 155.7 km)
1. Daniele Ratto (Italy / Cannondale) 4:24:00"
2. Vincenzo Nibali (Italy / Astana) +3:53"
3. Chris Horner (U.S. / RadioShack) +3:55"
4. Joaquim Rodriguez (Spain / Katusha) +4:11"
5. Samuel Sanchez (Spain / Euskaltel) +4:19"
6. Alejandro Valverde (Spain / Movistar) +4:43"
7. Thibaut Pinot (France / FDJ.fr) +4:46"
8. Domenico Pozzovivo (Italy / AG2R)
Classification from Vuelta a Espana after Stage 14
1. Vincenzo Nibali (Italy / Astana) 53:56:49"
2. Chris Horner (U.S. / RadioShack) +50"
3. Alejandro Valverde (Spain / Movistar) +1:42"
4. Joaquim Rodriguez (Spain / Katusha) +2:57"
5. Domenico Pozzovivo (Italy / AG2R) +3:43"
6. Nicolas Roche (Ireland / Saxo - Tinkoff) +4.06"
7. Thibaut Pinot (France / FDJ.fr) +4:34"