Hail Sithis!

Talk to Nazir
First, talk to Nazir and tell him the Night Mother has spoken to you and that the contract is still on.

Talk to Amaund Motierre
Then you must talk to Amaund Motierre in the back room of the The Bannered Mare In Whiterun, who will then tell you that the Emperor is on the Katariah ship about to leave Skyrim. He also mentions that Commander Maro will be at the East Empire Company Warehouse docks, giving you an optional kill.

(Optional) Kill Commander Maro
You may be able to walk up onto the archway and kill him with an arrow, but the most likely route is to run down the docks and kill him, then flee from the guards towards the Katariah. (Talking to him with a clean bounty will get him to attack you, and may have the guards on your side.) If you have finished the Stormcloak Quest line there will be Stormcloak Guards on the docks that will help you kill Commander Maro. An amulet of waterbreathing can be extremely helpful for this situation. You can also talk to him, which makes him attack you, thus rendering killing him self-defense and thus not a crime, with amusing dialog starting the fight as he's shocked to see you alive.

Board the Katariah
Swim northeast along the river to the Katariah. Dive underwater and climb the anchor chain on the east side of the ship.

Kill the Emperor!
Once on board there will be several sailors and Penitus Oculatus Agents. Do not worry if you alert some of the guards on patrol or stationary within the ship as it will not cause the entire ship to be alerted to your presence.

Go south to a dining room and climb the stairs to the main deck. An expert-locked door to the aft cabins is at the top of these stairs. Captain Avidius can be found in an forward cabin and drops the necessary Katariah Master Key. Use the master key or pick the lock to enter aft cabin area. Upon entering you can see that there is a room to your right with two Penitus Oculatus Agents, with smoke rising from the floor, you may kill them for no negative effects. Continue up the stairs and you will see the master-locked Emperor's Quarters; unlock with the master key. You may also get the key by killing the lieutenant who is in the room directly below the Emperor.

Once you proceed inside, Emperor Titus Mede II will start talking to you. He is accepting of his death, stating that this is his and your destiny. He will ask you a favor: kill whoever assigned the contract (Amaund Motierre). He will get up from his chair and proceed to turn his back to you and stare out a window allowing you to backstab him.

Report to Amaund Motierre
After you kill the Emperor, you can escape the ship through the door to the right. After going through this door, just jump in the water or fast travel away. You then have to go back to Whiterun and enter The Bannered Mare to talk to Amaund Motierre. He tells you the payment is in the dead drop in the cave where you first met. Travel to Volunruud to collect your dead-drop reward of 20,000 septims inside an urn. You must then talk to Nazir in the Dawnstar Sanctuary to finish the quest.

Retrieve the payment
Travel to Volunruud and retrieve 20,000 from an urn in the same chamber where you first met Motierre. There is no need to clear the entire location.

(Optional) Kill Amaund Motierre
If you choose to honour the Emperor's request to kill Motierre, return to Whiterun and dispatch him quietly in the rear of the Bannered Mare. He will say with his last words "But we had a.. deal...", and drop many valuble gems.
 * For those that plan on killing Amaund, immediately after gaining the location of the dead drop, you can hop up on the table, and backstab him with no consequences.
 * He also drops a flawless ruby, which is needed in the quest The Only Cure, this item is Semi-rare, so grab it while you can. (Note: If you are killing Amaund for the flawless ruby, you can also look in one of the rooms in the Emperors Chamber, pass an expert lockpick or use the Emperor's key, look in the end table next to his bed and you will find a flawless ruby.)

Report to Nazir
When you return to Nazir at the Dawnstar Sanctuary, he asks how much Motierre left you for completing the assassination and you have the option to lie. Whether or not you tell the truth, he will suggest you to speak to Delvin Mallory in Riften to see about repairing the Dawnstar Sanctuary with the gold you were rewarded. In return, Nazir says that once the repairs are complete he will start recruiting new members to the Dark Brotherhood. This completes the quest and begins the next, Where You Hang Your Enemy's Head. In any case, you get to keep the gold and spend it however you wish.

Loot
As you enter the Emperor's Room, to the player's left, through the locked door (which is an expert lock, or just use the Master Key) there is a copy of the Lost Legends on his nightstand by his bed. Read it and it will grant you the quest Forbidden Legend (if you haven't done it already). There are also some valuable gems and necklaces in the room, as well as the only gilded wristguards and one of the three copies of Emperors Robes. In front of Emperor Titus Mede II there is a book "Brother of Darkness" which tells some history of The Dark Brotherhood. There is also a map in front of him, the same as the "cloth physical map" that came with the game free of charge, if you pre-ordered. There is also a book called "King" that will raise the two-handed skill next to the throne on the Quarterdeck of The Katariah above the Emperor's side of the ship. On the opposite side, on the Forecastle Deck, there is a Scimitar called "Windshear" stuck in the end of the Bowsprit (the long wooden beam protruding from the bow). Windshear has an enchantment where bash attacks using this weapon have a chance to knock down an opponent.

Trivia

 * You can pickpocket Amaund Motierre for various Precious Gem.
 * After this quest, guards in any hold mention the Emperor's death.
 * The Emperor has an extensive library upon the ship.

Bugs

 * After finishing the Civil War questline for the Stormcloaks, killing the emperor may cause Solutide guards to be hostile and not give the option of paying off a bounty. Cause is unknown but you can use the console commands SetObectiveCompleted DB11 20 1 to complete the objective of killing the emperor (without killing him) and SetStage DB11 50 to proceed to the next stage of the quest.
 * On the other hand, if you wish to continue by having the emperor dead, the console command "killall" will kill him without making the guards hostile.
 * There is a chance that after assassinating the Emperor you are unable to fast travel or wait. The message: "You cannot fast travel / wait while guards are pursuing you." will appear even though you are in another hold outside Solitude. Using the wait command removes this. If you cannot wait, jump off the boat and swim to shore. You may need to kill some Mudcrabs and/or Horkers. Afterwards, look at the boat and when the red dots indicating your enemies disappear you can now fast travel.
 * There is also a chance that Amaund Motierre will fall through the floor if you kill him while he is sitting in his chair.
 * There is also a chance when killing Amaund Motierre that Olava will appear in the room after you murder him. In one case, she said "By Sithis you are persistent one," and then proceeded to sit on Motierre's body. Her son spawned in the room immediately after that and said "You've been a good friend to me." Loaded them in the wrong building for some reason. Another player (PC) had Olava appear before killing Motierre and give a vague reading of the future (the new Sanctuary will be like a home), but the son never spawned. Olava was present for the execution of Motierre, but did not report it to the guards and no bounty was gained.
 * It is possible to only receive 100 gold from the urn, which there appears to be no fix for. Save before you open the urn. (pc)
 * There is a chance that after killing Commander Maro that the entire game will glitch and transport you between the Emperor's room on the ship and the courtyard outside the castle in Solitude. (PS3)
 * On a rare occasion the boat you are supposed to climb into is actually invisible and forces NPCs to fall through the areas where floors are usually located. Once you climb onto the boat like you're supposed to the NPCs will start spawning behind you allowing you to kill them without them even noticing until they are almost dead. It also provides for an easier way of going through the ship seeing as most of the NPCs fell into the water and had to re-board the ship. So far the only fix for this is going onto the boat as scripted; or to reload from a previous save file before discovering the location. (Xbox 360)
 * There is a chance that after reciveing the 'Hail Sithis' mission, entering the river where the boat the emporior can be found on, will crash your console (PS3)

Achievements
Hail Sithis