Heart space-occupying lesions are a disease that occurs frequently in clinical setting, and therefore, it is important to diagnose and treat this type of pathologies properly. Angiographic echocardiography and transesophageal sonogram are widely used for clinical diagnosis. Their application provides a guarantee for the diagnosis of cardiac space-occupying lesions. In this paper, the application of cardiac contrast echocardiography and transesophageal echocardiography in cardiac space-occupying lesions was studied. Prediction of cardiac lesions can accurately determine the nature of cardiac occupancies and provide a basis for clinical diagnosis and management judgments. The results of pathological analysis and experimental comparison showed that myocardial contrast echocardiography can accurately distinguish tumor and thrombus and make contribution to patients taking appropriate medical measures. At the same time, it can compare conventional transthoracic echocardiography and transesophageal echocardiography. The results showed that TEE could clearly show the cardiac lesions. The experimental data of 76.9% confirmed cases showed that the diagnostic accuracy is greatly improved. TEE can also clearly show small thrombus that TTE cannot, in which 2DTEE can clearly show the boundary between the space-occupying and surrounding tissues, and whether there is a clear boundary between the space-occupying and surrounding tissues is an important distinguishing point of benign and malignant tumors. In addition, the TEE probe can also be used for large angle imaging and multiangle rotation, so as to determine the tumor boundary and the spatial position relationship between the tumor and the surrounding tissue. All in all, myocardial contrast echocardiography and transesophageal echocardiography have better clinical application effect on cardiac space-occupying lesions.