  The structure and spectrum of the accretion shock have been self-consistently
simulated for a wide range of parameters typical for Classical T Tauri Stars
(CTTS). Radiative cooling of the shocked gas was calculated, taking into
account the self-absorption and non-equilibrium (time-dependent) effects in the
level populations. These effects modify the standard cooling curve for an
optically thin plasma in coronal equilibrium, however the shape of
high-temperature ($T>3\times10^5$ K) part of the curve remains unchanged. The
applied methods allow us to smoothly describe the transition from the cooling
flow to the hydrostatic stellar atmosphere. Thanks to this approach, it has
been found that the narrow component of HeII lines is formed predominantly in
the irradiated stationary atmosphere (hotspot), i.e. at velocities of the
settling gas $<2$ km s$^{-1}$. The structure of the pre-shock region is
calculated simultaneously with the heated atmosphere. The simulation shows that
the pre-shock gas produces a noticeable emission component in HeII lines and
practically does not manifest itself in HeI lines ($\lambda\lambda$ 5876, 10830
{\AA}). The UV spectrum of the hotspot is distorted by the pre-shock gas,
namely numerous red-shifted emission and absorption lines overlap each other
forming a pseudo-continuum. The spectrum of the accretion region at high
pre-shock densities $\sim10^{14}$ cm$^{-3}$ is fully formed in the in-falling
gas and can be qualitatively described as a spectrum of a star with an
effective temperature derived from the Stefan-Boltzmann law via the full energy
flux.
