It happens to people when they get for example a heart attack they will get a near death experience (NDE). Sometimes they encounter a very bright light but sometimes persons like Jesus encounters them. Probably such experiences are very cultural influenced but are there studies of NDE in more Buddhist countries where Buddha appears in a NDE?
Not that I know of. I know some people encounter Lord Yama in their NDE but not Buddha. Maybe because Buddha has attained parinibbana.
The NDE is one and the same phenomena as the OBE (out of body experience) this is described by the Buddha as manomaya, or 'mind made body' and is expressed as a fruit of the contemplative life. One is able to leave body at will after the fourth jhana and as one develops the mind in the immaterial realms. This happens most often during sleep when the jhanas have been attained regularly. This is also known as astral plaining. The NDE is exactly this, this mind leaves the body in an astral body. Death, astral plaining and deep meditation are one and the same thing. I know a person who astral travels regularly and she has stated that she has met the Buddha. Even though his spirit has been liberated into Nibbana, she explains that a fragment of his consciousness still remains that continues to teach in the higher realms.