AIUI (based on now decades-old technical manuals, once read, thus perhaps superseded by canon), Trek-style transporters rip apart the subject's constituent atoms (down to the electronic level, at least), project the matter stream through subspace either to another transporter-pad (which can do shared work on getting the stream reconstructed, so can work at longer distances) or such that the matter 'falls out of subspace' in the configuration it was first in, while ensuring local atmosphere (and any other insubstantial matter) is displaced in the process. "Beaming up" from a non-pad location requires the impetus to push the matter into subspace and back
towards the receiving/fetching pad to be projected from the latter (handwavium applies!) and thus why special beacons are sometimes required to be placed around the person(s) to be retrieved in order to aid the process (provide a short-range triangulation backup, maybe act as partial relays of energy and/or matter-signals).
The process
may involve a stasis-field (on beaming in/out, the subject is often frozen in pose, you'll notice, as their phasing there/away process becomes apparent), but it's very much a case -
usually - of "one out, one in" as far as the universe is concerned, in that order, and a finite, positive, non-zero passage of timr between the two (sometimes quite lengthy... see /Relics/ for an extreme). If there's a non-physical/non-material/spiritual soul, then it maybe de-keys from the body upon the dissassembling and re-keys upon the body reassembled. Vague stories of having
experienced something whilst in the stream are maybe either psychosis or something in the echo-universe through which the spirit permeates whilst disembodied. But I think Lt Berkely is right to fear the process (even though almost always free of fatal problems, the Heisenburg Compensators serve to collimate and bind the stream together to prevent messiness upon reconstitution).
(By reading, interpreting and processing the stream, with
unimaginably powerful (probably Quantum) stream-sensors/manipulators, it is clearly possible to identify unauthorised weapon power-packs and de-charge them, and it was often possible to even to go from being seated at the remote location to standing up on the pad... Obviously a desirable feature to perfect so that one doesn't fall over all the time, in various circumstances. And the process must be powerful enough/expert enough to have spontaneously created the result seen in /Rascals/... Which included hair 'restoration' for the duration, even.)
Thomas Riker's circumstances are yet another exception. My best guess that, as a "quantum clone", any spirit that sits in the dimensionless universe alongside our physical bodies, relatching onto the beamed-in body as soon as it can, probably splits in the instant of two receptive bodies being available. As a presumably blank spirit (or maybe median mix of two parent ones) latches onto a new child, unless 'matters are arranged' via reincarnation. Or else a variant upon the
one electron theory. And then we're talking of the latched-to material brain having supremacy of nature over the spiritualistic component, to such a degree that the existence of the latter might not even be detectable any more... As it likely is.
The alternative replicate-to-transport method is to duplicate a traveller to their new location then destroy the original. If there's a single soul, there, then the duplication might by dually-latched by the intangible soul, for the time both bodies exist, before the old one is vaporised. And then imagine being the
consciousness within the source body. Do you see the scan process happening (as both you and the destination duplicate will later
remember you see happening) and then wait while conformation that "you" have arrived bounces back, to turn the copier-booth into a disintegrator-booth/whatever. New-you won't remember
that part, but when you're experiencing the wait (or the new-you currently awaiting completion of transport to a newer-you's location) you are going to be wondering whether the attempt has failed (try again later) or you're about to meet your own personal doom in a few short moments... (Maybe
minutes of this uncertainty, for transplanatary transport without the benefit of supralight communication methods.) That's just consciousness. The questions about the soul remain, but likely match up with the Thomas Riker example in the immediate term (quantum matching, followed by differentiation/mitosis of the spiritual 'thing', then
whatever happens upon death).
Or so I would say. With absolutely no grounds to base any of these assumptions on, or even that there's any reason to start making these types of assumptions in the first place.