We analyse the propagation of a shock wave into an atomic interstellar medium, taking into account radiative heating/cooling, thermal conduction, and physical viscosity, by means of three-dimensional magnetohydrodynamical simulations. The results show that the thermal instability in the post-shocked gas produces high-density molecular cloudlets embedded into a warm neutral phase. The molecular cloudlets have a velocity dispersion which is supersonic with respect to the sound speed of the cold medium and is subsonic with respect to the warm phase. The dynamical evolution driven by thermal instabilities in the shocked layer is an important basic process in the transition from a warm phase into cold molecular gas, as shock waves are frequently generated by supernovae in the Galaxy. Once the total column density of the ensamble of clouds becomes larger than the critical value (similar to 10(21)cm(-3)), the two-phase medium is expected to evolve into a single phase medium, within a cooling time-scale. The further evolution, driven by the gravitational force, is outlined.