In highly heterogeneous medium, such as one with lung tissue or air cavities, the dose in the low-density region or after it, as calculated by the conventional methods based on convolution with an energy-spreading kernel, is usually overestimated in comparison with measurements or more accurate predictions. To correct the overestimation, we propose a method of scaling the total energy released per mass (TERMA). The scaling depends on both the density distribution and the effective beam size in the lateraldirection. The corrected convolution method achieved a significantly improved accuracy in both the lung-like tissue and the water-like region after air, compared to the uncorrected method. The TERMA correction only adds about 10% to the overall computationalcost. Due to the improvement in accuracy and the preservation of computational efficiency, the proposed dose calculation method will be valuable for inverse treatmentplanning.