How do shock waves form in space? Today my aerodynamics professor mentioned that the equations we were learning for atmospheric shock waves can also be applied by astrophysicists to study black hole-related shock waves in space.
How is this possible? Isn't space too rarefied for shock waves? What is an example application? He mentioned something about the density limit before/after a relativistic shock approaching 6.
 A: Space isn't empty, as I'm sure you've heard before. There's always something between different bodies, such as the interstellar medium. There are also denser regions of space, including molecular clouds and H I/H II regions. Shockwaves can form in any of these places, and propagate through them. There are several different common sources of these shock waves (see McKee & Hollenbach (1980)):


*

*Young stars with strong stellar winds

*Supernovae

*Galaxy mergers


Shock waves can also form on larger scales (see Bykov et al. (2008)), due to things like galaxy mergers (as were mentioned above) and the formation of large structures (e.g. filaments and galaxy superclusters). These "cosmological" shockwaves can propagate through the intergalactic medium, intergalactic medium or the intracluster medium.
See here for some other minor sources and shock front speeds.
A: A Little History
You ask a very good and relevant question.  In fact, back in 1958 H.E. Petschek wrote an interesting paper on "Aerodynamic Dissipation".  In that paper, he hypothesized that one could, in theory, produce a shock wave in a collisionless medium (like most plasmas in space).  This was highly controversial, since the very concept of a shock wave requires some form of irreversible energy dissipation in order for the structure to form.  I wrote a few more details here and here.
Shortly after, Paul J. Kellogg predicted the existence of a bow shock around the Earth's magnetosphere.  This was later confirmed by some of the first spacecraft observations.  The controversy I mentioned earlier arose because a truly collisionless plasma is governed by the Vlasov equation (i.e., just the Boltzmann equation without the collision operator), which is a time-reversible equation of motion in kinetic theory.  This is a problem because the formation of a shock wave requires energy dissipation (i.e., entropy generation and/or time-irreversibility).
Irreversibility
As I discussed here, some form of energy dissipation is required to halt nonlinear wave steepening.  Originally, there was debate as to how the Vlasov equation could supply any form of irreversibility.  I wrote a response here that discusses irreversibility in more detail.  None-the-less, shock waves can form in plasmas and are governed by the Rankine-Hugoniot relations.  
Relevant Speeds
Generally, for a shock wave to form one needs a piston moving through a medium faster than the relevant speed of communication.  As I illustrated in this answer, there are multiple relevant speeds in space plasmas.  Theory suggests one can get a slow mode shock wave to form in plasmas, but there is little evidence of those (at least of which I am aware).  The more relevant speed is the fast mode or magnetosonic mode (Note: there are much better descriptions elsewhere on the web than the Wikipedia link, but that one was quick and easy).  So the bow shock upstream of the Earth is a fast mode shock (thus the Mach number is defined with the fast mode phase speed), as are most astrophysical shocks to which you may be referred.
Density Limit
I am going to guess here, as I would need more information to answer properly, but I think your professor might have been talking about an asymptotic limit of the Rankine-Hugoniot relations for high Mach numbers.  In the limit as the Mach number goes to some large number, the density compression ratio across a hydrodynamic shock goes to 4 (assuming a polytrope index of 5/3).  One can make a similar argument for magnetohydrodynamic shock waves.
A: The first underlying question is "what is a fluid", and in which condition we can consider we have one. At the time the Feynam courses were written (i.e. days of manual calculus with few digits ;-) ), it was considered that you need the space and time of 100 collisions, i.e. 100 mean free path. less than this you are in the mecanics of collision between particules, or agregates physics, or complicated intermediates where pressure has not yet collapse (i.e. be thermalized) into a scalar. 
Interstellar medium is not dense, but not empty. Objects like nebula or dust clouds are ultra large. Time scale considered are also vast. So that they can perfectly fit the condition of fluids, with "sound waves", supersonic motions, etc.
( The specificity is that this medium it often at least partly ionized, so that fluid mechanics is not playing alone: you also have EM, i.e. plasma physics, + auto-gravity. ).
