I would think light would be more precise than sound as it travels faster and is less bothered by air temperature, humidity, barometric pressure, etc.
Would it be naive to measure speed by taking the time it takes to get from one beam to another when knowing the distance between the two beams?
Also, I've been thinking about implementing a similar system for my U-shaped driveway to tell me which side is full. However, if I use an ultrasonic or beam, is there any way to avoid counting objects that aren't cars? This is kind of related to my previous inquiry about preventing the sensors from detecting my dog entering my room.