Car test Ray problem in BGE
You already know what is causing the problem, it is because your script is trying to loop through a empty list (when the ray sensor is not hitting anything.)

All you have to do to fix it is add one line to your script.

if sol:
    #then your if statements goes in here


or change your if statement to this:

if sol and 'Sable' in sol and own['Vitesse'] &gt; 10:


That one line checks to see if your ray is hitting anything, if it is then the rest of your logic will run. If the ray hits nothing, then there is no error because nothing happens.