Statistical mechanics of pendular molecules