I went there last summer and recommend you purchase a Japan Rail Pass
http://www.japanrailpass.net/eng/en001.html before you arrive and take the bullet train (I think 2 1/2 hours trip) to Kyoto for a couple of days and then Kyoto to Osaka (30 minute by bullet train) and spend couple of days before returning to Tokyo.