Yim closed with an even-par 72 to finish the tournament at 16-under-par 272 for a two-shot victory over Sorenstam, Cristie Kerr and Karrie Webb.
She stumbled to a 3-over 75 in her final round to end at 14-under-par 274.
'There's not much to say other than it was a horrible day, and I would like to forget about it,' said Sorenstam, who also had five bogeys to go along with four birdies.
'There were a lot of shots today that didn't happen.'
The last time Sorenstam held a third-round lead and didn't come away with the win was at the 2004 Evian Masters. Looking for her 68th career victory, she entered the day having won each of the last six times she held at least a share of the 54-hole lead.
'I'm more disappointed in me than anything else,' Sorenstam said.
Kerr shot a three-under 69 to move into a tie for second, while Webb got there with a final-round 70. Suzann Pettersen, Juli Inkster and Hee-Won Han shared fifth place, one stroke further back at minus-13.
Not only had Sorenstam won each of the last six times she held at least a share of the 54-hole lead, she had also done it 27-of-44 times in her career.
But something was wrong with the world's top female golfer from the beginning on Sunday.
Sorenstam opened with a three-putt bogey at the par-four first, and would later go bogey-birdie, bogey-birdie on four consecutive holes from the fourth.
Two more bogeys at 10 and 12 -- including one on another three-putt at 12 -- dropped her into a three-way tie for the lead with Kerr and Yim at minus-14.
Kerr briefly held the lead alone after a birdie ahead at the 14th, but she double-bogeyed the 15th. Sorenstam and Yim then reclaimed the lead with matching birdies at the par-4 14th.
Sorenstam could have salvaged a bogey at 17, but she two-putted after knocking a 7-iron within 5 feet. After closing with a birdie to earn her share of second place, all Sorenstam wanted to do was forget about the round.
'I'm not going to the range,' Sorenstam said afterward. 'I'm going home. I'm just going to get focused and get my game ready for next week.'
Meanwhile, Yim quietly finished off an even-par round by making a four on 17 before rolling in a birdie putt at the 18th for her two-shot win and a $210,000 paycheck.
Sorenstam was impressed with one aspect of the South Korean's game in particular.
'She didn't hit greens, but her short game helped her,' said Sorenstam. 'She had a lot of up and downs to keep the score going. And she missed a lot of putts early on, kind of like I did, but in the end she was pretty solid.'
Karine Icher fired a 3-under 69 to move into a share of eighth place with Jeong Jang (72) and Sherri Turner (72) at minus-12. Beth Daniel (73) and Brittany Lang (73) were knotted in 11th place, one shot further back.