In this paper, we present the numerical solution of the Stefan problem to calculate the temperature of the tungsten sample heated by the laser pulse. Mathematical modeling is carried out to analyze field experiments, where an instantaneous heating of the plate to 9000K is observed due to the effect of a heat flow on its surface and subsequent cooling. The problem is characterized by nonlinear coefficients and boundary conditions. An important role is played by the evaporation of the metal from the heated surface. Basing on Samarskii’s approach, we choose to implement the method of continuous counting considering the heat conductivity equation in a uniform form in the entire domain using the Dirac delta function. The numerical method has the second-order of approximation with respect to space, the interval of smoothing of the coefficients is 5K. As a result, we obtain the temperature distributions on the surface and in the cross section of the sample during cooling.