See
http://www.emirates.com/english/plan...stopovers.aspx
If you are booked in one of the fare classes shown in the link and are staying over 8 hours, Emirates will pay for your hotel and you don't need a visa to enter Dubai. Just have your reservation and passport details available, call EK and tell them to book you in the Millenium Hotel for your long layover (as long as your connecting flight is the next flight to your final destination). You have to book at least 24 hours in advance and you will pick up your voucher when you check in. Once you get to Dubai, they will arrange a visa for you at the airport if you need it. Otherwise, just go through immigration and customs, turn left once you are out of the customs area and the Millenium Hotel transfer desk is at the end of the hall. You will be brought over to the hotel, given a voucher for dinner and breakfast and taken back to the airport the next morning. No need to waste money and a nights sleep when EK will cover the cost of everything.