A teenager has been left needing hospital treatment after being hit by a car and then attacked in Ripon.