The American ninth seed extended her winning streak over the Russian World No. 2 to seven in a row and to eight from 10 meetings, since they first clashed in Miami [ Images ] back in 2004.
Williams, unbeaten on clay this season, battered down 11 aces, including one on a second serve at break-point in the seventh game of the second set, which seemed to end any hopes Sharapova may have had of coming back into the match.
She will meet either fifth-seed Samantha Stosur [ Images ] or Czech qualifier Lucie Hradecka in the semi-finals.
The Belarussian, runner up in Madrid last year, looked to be cruising at 4-1 up in the third before China's Li broke back.
Li was unable to take advantage of four break-point chances, however, and 36 unforced errors told its own story.
Photograph: Jasper Juinen / Getty Images