Coherence in a thermal ensemble