An Andre Gray hat-trick separated newly-promoted Rangers and Burnley as Sean Dyche's men won 3-1 at Ibrox.