We study matter effects which arise in the muon neutrino oscillation and survival probabilities relevant to atmospheric neutrino and very long baseline ( > 4000 Km) beam experiments. The interrelations between the three probabilities P e , P , and P are examined. It is shown that large and observable sensitivity to the neutrino mass hierarchy can be present in P and P . We emphasize that at baselines >7000 Km, matter effects in P are important under certain conditions and can be large. The muon survival rates in experiments with very long baselines thus depend on matter effects in both P and P e . We also indicate where these effects provide sensitivity to 13 and identify ranges of energies and baselines where this sensitivity is maximum. The effect of parameter degeneracies in the three probabilities at these baselines and energies is studied in detail and large parts of the parameter space are identified which are free from these degeneracies. In the second part of the paper, we focus on using the matter effects studied in the first part as a means of determining the mass hierarchy via atmospheric neutrinos. Realistic event rate calculations are performed for a charge discriminating 100 kT iron calorimeter which demonstrate the possibility of realizing this very important goal in neutrino physics. It is shown that for atmospheric neutrinos, a careful selection of energy and baseline ranges is necessary in order to obtain a statistically significant signal, and that the effects are largest in bins where matter effects in both P e and P combine constructively. Under these conditions, up to a 4 signal for matter effects is possible (for 31 > 0) within a time scale appreciably shorter than the one anticipated for neutrino factories.