Kyler Murray threw for 242 yards and four touchdowns, two to Greg Dortch, and Arizona beat injury-depleted San Francisco.