Some excellent advice on this thread and a great summary by DataDan.
I have now been commuting and lane sharing daily up and down the Bay, 101, 880, 580, for close to 20 years without a single crash.
While I would love to share a magic recipe, I am all too aware that some of it comes down to good luck. With that out of the way, I would add the following to what Data Dan and OaklandF4i said:
- Focus: regardless of how little you slept, how early you woke up, how long of a working day you had, how upset your wife or co-worker made you or where you need to get to, when you get on the bike, take 10sec to take a breath, clear your head and get all your attention on riding and on the road.
- Always look for escape paths: If the path between two cars closes at the last minute, getting on the brakes is rarely the best option. More often than not you won't stop in time. It's much better to have identified another path ahead of time and quickly switch.
- Whats legal is not always the safest option: I know I am going to get crap for that one, I am not advocating breaking the law, I am merely saying that following yellow lines can be a form of target fixation. When looking for escape paths also consider shoulders or wherever there might be space you can use in a pinch.
- Be razor accurate with your steering: For example practice riding on a line at different speeds, with wind, without wind. Be mindful of the turbulences created by large vehicles, they will push or pull you, anticipate and keep your wheels exactly where you want them to be. An inch can be the difference between staying up or going down. Again I am not advocating getting within one inch of a car, simply to steer as if all you had was an inch rather than being lulled into steering sloppily just because there is space.
- Be decisive: I see everyday riders hanging a few feets away to the rear right corner of cars. Waiting for who knows what sign that it is safe to pass. If you are not ready to pass stay at a safe distance from the car ahead of you. Once you are ready to pass, whatever it means, you made eye contact with the driver, the gap between cars has widen, etc. pass decisively.
As Budman mentioned earlier, none of these "techniques" are meant for new riders, or riders with little experience.
My 2 cents.