You might take him to the vet for some sedation. It might calm him down for a while, or until whatever is bothering him passes.
Melatonin works absolute wonders for stress in dogs (especially at night, of course), and it's very safe and cheap.