How do you tell if a wave is reflected or refracted at an interface? My physics textbook says that a wave traveling through medium $1$ will enter medium  $2$ if medium $1$ has a higher index of refraction. Otherwise, the wave will be reflected. This makes absolutely no sense to me, since this would mean all sunlight traveling through the vacuum of space would just bounce off Earth's atmosphere since air has a higher index of refraction than a vacuum.
There has to be something else that goes on for determining if a wave will be reflected or refracted at an interface, but my textbook doesn't elaborate any further past the statement already mentioned. Can someone tell me what the actual criteria is?
Edit
Nevermind, I misread the passage. Turns out the terms "reflect" and "invert" are not nearly as interchangeable as I thought they were.
 A: It's good that it makes absolutely no sense to you, because that is absolutely wrong, and if your book truly says that then it should be cast into the nearest volcano as soon as possible.
In general, light incident upon an interface will be neither completely reflected nor completely transmitted.  The Fresnel equations are used to determine the reflection and transmission coefficients $R$ and $T$, which tell you what fraction of the incident light is reflected and transmitted, respectively.
Unfortunately, the Fresnel equations are rather complicated, and depend both on the refractive indices of the two media as well as the polarization of the incoming wave.  If we make a few simplifying assumptions for normal materials and visible light, we have the following:  
For $p$-polarized waves, in which the electric field oscillates in the same plane as the interface, the reflection coefficient is
$$R_p = \left|\frac{n_1\sqrt{1-\left(\frac{n_1}{n_2}\sin(\theta_i)\right)^2}-n_2\cos(\theta_i)}{n_1 \sqrt{1-\left(\frac{n_1}{n_2}\sin(\theta_i)\right)^2}+n_2\cos(\theta_i)}\right|$$
For $s$-polarized waves, in which the electric field oscillates in the direction normal to the interface, the reflection coefficient is
$$R_s = \left|\frac{n_1\cos(\theta_i) - n_2\sqrt{1-\left(\frac{n_1}{n_2}\sin(\theta_i)\right)^2}}{n_1\cos(\theta_i) +  n_2\sqrt{1-\left(\frac{n_1}{n_2}\sin(\theta_i)\right)^2}}\right|$$
In both cases, the amount of light (specifically, the intensity of the beam as a fraction of the incident intensity) transmitted is $T_{s/p} = 1-R_{s/p}$.
