Is there any concept of an after-life in Tolken's Middle Earth and does it vary for the races?

What I have been able to glean:

  1. The elves can go to the undying lands when they choose but it is not clear if they go there when they are killed?

  2. The care and ritual with which the men seem to treat the dead suggests that there is some form of religion-like concepts for the passage into death.

  3. The existence of wraiths and ghosts seem to indicate that consciousness can exist beyond the physical form but this always seems to be a negative thing.