Fans race to get foul ball in San Francisco