Apparatus and method for utilizing thermal energy