The ninth-seeded American powered through 6-1 6-3 and next plays Czech qualifier Lucie Hradecka while world number one Victoria Azarenka will meet third-ranked Agnieszka Radwanska for the sixth time this year.
Williams extended her record against Sharapova to eight wins in 10 meetings since they first clashed in Miami in 2004.
Unbeaten in 11 outings on clay this season, she battered down 11 aces including one on a second serve at break-point in the seventh game of the second set to end any hopes of a Russian fightback.
Williams then took her opponent's serve apart again, setting up three match points before burying a volley to wrap up the most one-sided of the four quarter-finals.
"When you are playing her you have to be ready because she ... does everything well," 13-times grand slam singles champion Williams told reporters.
"I'm doing well. I'm really focused on my tennis right now and I think that has been helping my level. I'm just trying to get back to my 2002 level, that's my challenge," the American added referring to the year she won three grand slams.
"I'm not there yet but I feel I can do much better and I just want to keep on doing that."
The Belarussian, runner-up in Madrid last year, was cruising at 4-1 in the third set before Li fought back.
Li, however, was unable to take advantage of four break points and a total of 36 unforced errors told its own story.
Asked if it was confidence from having won four titles this year that had seen her through, Azarenka responded: "It wasn't very much to do with confidence.
"I was thinking I had to change and come up with things to surprise her because she was playing unbelievably in the first set. I had to turn it around.
"I don't know if it was confidence, or belief, or whether it was just pushing myself to be better."
Azarenka also gave her views on the controversial blue clay courts, an innovation at this year's tournament which men's world numbers one and two Novak Djokovic and Rafa Nadal slammed on Thursday.
"I'm not a fan of this court, that's for sure," she added. "But I don't want to sit here and complain about it.
"Nothing is going to change this year. We can talk after the tournament about possible changes."
Radwanska can rise to world number two if she wins the title here.