What Hamlet is musing on is the comparison between the pain of life, which he sees as inevitable (the sea of troubles - the slings and arrows - the heart-ache - the thousand natural shocks) and the fear of the uncertainty of death and of possible damnation of suicide.
Hamlet's dilemma is that although he is dissatisfied with life and lists its many torments, he is unsure what death may bring (the dread of something after death). He can't be sure what death has in store; it may be sleep but in perchance to dream he is speculating that it is perhaps an experience worse than life. Death is called the undiscover'd country from which no traveller returns. In saying that Hamlet is acknowledging that, not only does each living person discover death for themselves, as no one can return from it to describe it, but also that suicide os a one-way ticket. If you get the judgment call wrong, there's no way back.
The whole speech is tinged with the Christian prohibition of suicide, although it isn't mentioned explicitly. The dread of something after death would have been well understood by a Tudor audience to mean the fires of Hell.
The speech is a subtle and profound examining of what is more crudely expressed in the phrase out of the frying pan into the fire. - in essence 'life is bad, but death might be worse'.
I was having this thoughts over the last few weeks. @ SOIL, I am facing this issue whether To Be or NOT To Be.... Since it is bit more personal and contain harsh words. You can have more insight @ http://lifeatsoil.wordpress.com