Nicky Law and Jon Daly scored second-half goals as Rangers extended their unbeaten run with a 2-0 win over Ayr United.