If you hike all the way to Machu Picchu, our recommended Route has take the train out. The train is not inexpensive. Cheapest official fares in 2005:
Aguas Calientes <> Ollantaytambo US$41.65 one way, $65.45 return
Aguas Calientes <> Cuzco US$41.65 one way, $69.02 return
Check the Peru Rail rates page to double-check these fares. More expensive options are available.
Note that the fare is the same, even though Ollantaytambo is about half way to Cuzco. (It makes no sense to us either.) Luckily, Ollantaytambo in the Sacred Valley is an excellent stop anyway to visit Inca ruins. You can get an inexpensive bus from there to Cuzco.
Not posted on the Peru Rail website in 2004 were the cheapest fares. Once you get to Cuzco, ask about the Backpacker special, a train which runs Ollantayambo <> Aguas Calientes only a couple of times / week. (It may not fit your hiking schedule, however. You would need to book your ticket in advance, guessing which day you want to return from Cuzco.)
update In January, 2005 the inexpensive backpacker train service is no longer running. Too bad.
If you wait to book your train back to Cuzco until you finish the hike (in Aguas Calientes), your options may be limited. Cheaper seats may be sold out or you may need to wait a day or two to get one.
Bus
The reliability of bus travel in the Peruvian Andes has improved greatly over the years.
Most long-term travellers get around this way.
Our Recommended Routes include details on how to bus Cuzco to the trailhead at Cachora.
Bus Cuzco > Lima is very easy to organize. Fares start around US$20 one way for a modern vehicle. The fare coming from Lima is the same, but many have hassles finding and getting to the correct bus station in the big city. You can end up cabbing from terminal to terminal in rush hour (as we did) if you are not careful.
Bus discounts may be available if you have a student card. Low season fares can be very low.
Other easily arranged bus journeys for hikers include: