A Japan Rail Pass (or JR Pass) offers unlimited travel on most trains including Shinkansen, buses and ferries operated by Japan Railways Group throughout Japan, for one, two or three weeks.
It is available only for those travellers visiting Japan from abroad as tourists and you have to buy an exchange voucher BEFORE you travel to Japan. You can buy the JR pass online or through travel agents across the world.