The eagerly awaited match pitted Davenport, who was 19-1 with three titles since returning to the tour, against a former Grand Slam winner for the first time since she took maternity leave to give birth to son, Jagger, last June.
"From the day I found out, I started working for this game," Sharapova said of the draw. "I approached it like it's a final."
Earlier, Serena Williams and top-ranked Justine Henin scored straight-set victories to move a step closer to a possible semifinal showdown. No. 18 Amelie Mauresmo, who won the 2006 title, needed 10 match points to beat Yaroslava Shvedova.
On the men's side, second-ranked Rafael Nadal breezed to a straight-set win.
Locked in and sharp from the start, Sharapova yielded only six points in the first five games, keeping Davenport constantly on the run. Nothing much was going right for Davenport, who watched serves returned for winners and passing shots zip past when she ventured to the net.
The crowd, which started evenly divided between the players, largely shifted to underdog Davenport and cheered loudly when she finally held for her first game to pull to 5-1.
"I wish I could've given them a little more to cheer for," Daven-port said. "Obviously I wanted to play a little better than I did in the beginning, but she was really aggressive on me.
"She was head and shoulders better than I was. I felt like I never really hit the ball that well, and I'm in trouble when I'm not hitting the ball well."
Williams was the aggressor in a 6-3, 6-1 win over Yuan Meng, hitting so hard on nearly every shot that she seemed to be trying to reduce the ball to bits of fluff.
Henin committed only five unforced errors to take the first set against Olga Poutchkova 6-1 in 22 minutes. But Poutchkova began picking up her game, and Henin appeared to be bothered by gusty winds that made every service toss an adventure.
Despite five double-faults in her first two service games of the second set, Henin won 7-5 and claimed her 30th consecutive victory.
Nadal routed Florent Serra 6-0, 6-2, 6-2.
Seeking his first Grand Slam title on a surface other than the French Open's clay, Nadal yielded only 10 points while racing through the first set in 22 minutes, committing only four unforced errors.