This paper proposes a new method for estimating the contribution from different ionospheric regions to the response of total electron content variations to the solar flare which uses the effect of partial shadowing of the atmosphere by the terrestrial globe. The study uses GPS stations located near the boundary of the shadow on the ground in the nightside hemisphere. The beams between the satellite-borne transmitter and the receiver on the ground for these stations pass partially through the atmosphere lying in the region of total shadow and partially through the illuminated atmosphere. The analysis of the ionospheric effect of a powerful solar flare of class X5.7/3B that was recorded on July 14, 2000 (10:24 UT, N22W07) in quiet geomagnetic conditions (Dst=-10 nT) has shown that about 20% of the TEC increase correspond to the ionospheric region lying below 100 km, about 5% refer to the ionospheric E-region (100-140 km), about 30% correspond to the F1-region (140-200 km), and about 30% to regions lying above 300 km.