Halep was leading 6-1, 2-1 when Rybarikova retired ill to set up a meeting with Sharapova, who holds a 7-0 record against Halep in their head-to-head meetings.
Earlier in the day, wildcard Sharapova outlasted fellow Russian Ekaterina Makarova, 6-4, 4-6, 6-1, to advance to the third round.
Both Russians returned serve exceptionally well throughout, with 12 breaks of serve off of 16 opportunities to break. They totalled 58 winners where second serves were punished.
“You can take a little bit away from all the matches we’ve played in the past,” Sharapova said afterwards of her matchup against Halep next. “We know each other’s games very well. They’ve always been very challenging, tough, competitive, emotional.
“She’s a great player. She’s had a great year. Any time you’re able to face an opponent that’s done something right and well, it’s great to see where you are and where your level is.”
Czech Petra Kvitova defeated American qualifier Varvara Lepchenko 6-4, 6-4 in a battle between the left-handers where the 12th seed was rarely tested in the 78-minute match.
World No.4 Karolina Pliskova got past Andrea Petkovic of Germany 6-4, 6-4 to reach the last 16.
The Czech made a confident start and managed to break her opponents serve in the seventh game to go on and claim the opener 6-4.
In a closely contested second set, the only break came in the seventh game and it was all Pliskova needed to claim the set and match 6-4 in one hour and 41 minutes.
Other results on Tuesday:
Daria Kasatkina (RUS) bt Lara Arruabarrena (SPA) 6-4, 7-5
Elena Vesnina (RUS) bt Duan Yingying (CHI) 6-3, 6-2
Barbora Strýcová (CZE) bt Julia Görges (GER) 6-4, 6-2
Daria Gavrilova (AUS) bt CoCo Vandeweghe (US) 6-3, 2-0 (retired)
Sorana Cîrstea (ROM) bt Christina McHale (US) 7-6(4), 6-0