attach a blowoff hose and run it into a small jug. use a hose that fits into the neck of the carboy snugly and let it overflow into the jug until it settles down. then re-attach the airlock.
anti foaming agent may help. I know it helps keep down the foam during the boil when making beer.