The 13-time Grand Slam champion, battling to regain her elite ranking status after a lengthy layoff for injury and illness, on Thursday defeated Russian Maria Kirilenko 6-2, 3-6, 6-2.
“I’m sure we’ll both go out and do the best each of us can,” Williams said of her looming clash with Sharapova, another former world number one. “It’s nothing personal. It’s my job and I want to get paid. I leave it on the court.”
After winning Wimbledon in 2010, Williams cut her foot and required surgery. She then dealt with blood clots in her lungs and ultimately was on the sidelines until her return at Eastbourne in June.
Stanford is her third tournament since last year’s Wimbledon, and her first tournament on US soil since the 2009 US Open.
Williams took a medical timeout in her match to have her left ankle re-taped because of a blister.
But after Kirilenko won the second set and took the first game of the third, Williams seemed to wake up.
“I was a little sluggish out there,” Williams admitted. “I got upset and started playing well enough to win. I started out fine, but after that injury timeout I was sluggish.”
Williams said she’s trying to be patient in setting the goals for her comeback, but she acknowledged she wants to win.
“If I say I just want to play well, it’s a lie,” she said. “Would I be happy about losing? When I’m playing I get a little psycho and on the edge.”
Sharapova, the second seed, advanced on Wednesday with a win over Daniela Hantuchova.
Top-seeded Victoria Azarenka of Belarus, who defeated Sharapova in the final here last year, crashed out to New Zealand qualifier Marina Erakovic 4-6, 7-5, 6-2.
Erakovic, ranked 121st in the world, stunned Azarenka and notched her first victory over a top-20 opponent and reached her second quarter-final of a season in which she has won 24 of her last 28 matches.
Belarus’ Azarenka, ranked fourth in the world, arrived in Stanford for this hardcourt US Open tuneup off a semi-final appearance at Wimbledon.
She may have been a little rusty after the first-round bye given to the top four seeds.
Erakovic, 23, next faces eighth-seeded Slovakian Dominika Cibulkova.
“Coming in I knew I had to be the aggressor and try to dictate the pace,” Erakovic said. “I knew the court and I felt like I was hitting the ball well.”
Germany’s Wimbledon semi-finalist Sabine Lisicki ousted fourth-seeded Australian Samantha Stosur 6-3, 7-5.
Stosur, who had reached the semi-finals here the past two years, teamed with Lisicki to reach the women’s doubles final at Wimbledon.
Lisicki next faces fifth-seeded Agnieszka Radwanska of Poland, who advanced on Wednesday with a win over Taiwan’s Chang Kai-Chen.
Friday’s remaining quarterfinal will pit French third seed against Japan’s Ayumi Morita, a 4-6, 7-5, 6-1 winner over qualifier Urszula Radwanska.