"You played unbelievable," Sharapova told Wang, after the Chinese player announced she was retiring from the match, adding that the teenager had a great career ahead of her.
"It's not the way either of us wants to finish the match, win or lose," said Sharapova, who is ranked 29.
"I thought (Wang) was absolutely the dominant player in this match, and had all the opportunities to win it, even though I felt like I was finding my stride and getting a little bit closer to the line and being more aggressive."
Wang won two junior doubles titles last year at two Grand Slam tournaments (at Wimbledon and the Australian Open). She was given a wildcard for the tournament in Shenzhen.
In the next round, Sharapova takes on top-seed Belorussian Aryna Sabalenka, who had an easy win over Russian Ekaterina Alexandrova on Wednesday 6-3, 6-3.