A boy is in hospital with critical injuries after he was struck by a car.