Serious trouble resulting from some action, as in There'll be the devil to pay if you let that dog out. This expression originally referred to trouble resulting from making a bargain with the devil, but later was broadened to apply to any sort of problem. A variant,
the devil to pay and no pitch hot, first recorded in 1865, gave rise to the theory that the expression was originally nautical, since pay also means “to waterproof a seam by caulking it with pitch,” and no pitch hot meant it was a particularly difficult job, since cold pitch is hard to use. However, the original expression is much older and is the one that survives.
[ c. 1400