The ethics of self driving cars

An interesting article brings up one of my favorite philosophical problems. Suppose Google’s self driving cars become common. You’re riding in one. Then something goes wrong, an oncoming car loses control and is headed right for you. The only alternative to a head on collision is to swerve into the right hand lane, where there just happens to be a full school bus. Swerving will cause the school bus to crash. What should the self driving car do? Should it protect the car’s owner at the cost of a bus full of children?

This is called the trolley problem. There are a number of interesting variants, but just how should the autonomous car react?