If you're willing to design and build some hardware, how about a cheap photo-sensor (photo-diode or photo-transistor) and a simple light source? You can find sensors from Fairchild, Honeywell, Omron, Optek, and probably a bunch of others.
A lot of these sensors act basically as a switch: they conduct when they see light. Connect one side of the sensor to a pull-up and the other side to ground and check the output at the junction of the pull-up and the sensor. You'll get an inverted output: when it sees the light, the 'switch' is on and the output is low; when the ball blocks the light, the switch is off and the output is high (pulled up).