Beazer swings to loss in the third quarter