Williams came into the quarter-final match off the back of an impressive win over top seed and world number two Victoria Azarenka.
But Bouchard, ranked 17 places higher than Williams at 46 in the world, was also on a good run having beaten Jelena Jankovic in straight sets to reach the last eight.
After recovering from an early break down, Wiliams, who continues to fight an auto-immune disease, looked solid in the first set before Bouchard levelled the match in a second set tie-break.
The American finished the stronger of the two, however, storming out to a 5-2 lead before closing out the match two games later after just over three hours.
"Wow, she played so well, she's going to be a great player - she already is a great player," Williams said in her on-court interview.
"I was just competing out there today, just fighting until the end. It was disappointing to lose the second set, but to win the third set is the goal, so I'm happy I did that."
Williams will face Petra Kvitova in the last four. The Czech seventh seed came through two matches in one day when she defeated Svetlana Kuznetsova 6-4 6-1 to reach the semi-finals.
Kuznetsova and Kvitova both won their rain-delayed third round matches in straight sets, against Sorana Cirstea and Madison Keys respectively, before returning to the court to face each other.
The world number 11, currently seventh in the race to the WTA Championships, had too much for unseeded Kuznetsova and set up the meeting with Williams in just 72 minutes.
Second seed Agnieszka Radwanska’s winning streak finally came to an end with a 6-4 6-4 defeat at the hands of German fifth seed Angelique Kerber.
Radwanska came into the match having won seven straight matches, including picking up the title in Seoul last week. But the Pole was out-hit from the start and slapped down three double faults as Kerber progressed to the last four, where she will face fourth seed Caroline Wozniacki.
Wozniacki produced a typical battling performance as she was forced to recover from dropping the first set before grinding out a 2-6 6-3 6-2 win over Czech Lucie Safarova.