World number one Serena Williams defeated Maria Sharapova in three sets to win the Sony Open Tennis in Miami on Saturday.