  Stars are bad neighbors: they often disturb their surroundings. They
sometimes travel very fast through the interstellar medium (ISM). They
frequently undergo violent ejection events which leave an imprint on their
neighborhood (jets, winds, supernovae). These supersonic flows generate shocks
both in the ejected material (bow shock) and in the stellar environment
(termination shock). The global purpose of this thesis is to link the
properties of stars and the ISM by studying these shocks. We model them with
the Paris-Durham planar shock code, which incorporates a wealth of
micro-physics and chemical processes relevant to the magnetized ISM.
  In the first part, we model 3D magnetized axis-symmetric bow shock by a
statistical distribution of 1D planar shocks computed with the Paris-Durham
model. For the first time, we examine systematically the effect of the
geometry, age, and various other parameters on the H2 excitation diagram and
emission line profiles. Then, we will show that this 3D bow shock model
unprecedentedly improves interpretations of the H2 observations inOrion BN-KL
and BHR71, and show how spectral resolved H2 line emission profiles on the
Herbig-Haro objects HH54 can be used to extract a wealth of dynamical
information.
  In the second part, we model 1D steady stellar winds from AGB stars, which
trigger the termination shock, by including relevant physical and chemical
ingredients in the Paris-Durham code. For the first time, we examine the
time-dependent conversion of atomic to molecular hydrogen along the wind
trajectories of "hot" and "cold" AGB stars. We suggest that the low abundance
of HI inferred from observations is due to hydrogen locked in its molecular
form. Then, we try to reproduce HI 21-cm line profile in a "hot" AGB (called Y
CVn) and a "cold" AGB (called CW Leo).
