To achieve what you describe requires 3 separate exposures - these can all be achieved within the same frame with due care.
To get a clear but ghostly image the ghost either needs to remain in one place for part of the exposure or be flash-lit at the point where it needs to be clear.
To get a blurred moving ghosts image the ghost needs to move through the frame.
The background is usually lit throughout the frame.
The super enthused could use "bulb" and turn lighting on and off and move the ghosts etc in dark periods. This would allow eg ghosts to move to a location, position themselves steadily and then have lights turned on.
The background will also be lit by any flash used to highlight the stationary ghost and/or the background can be lit with a flash when the ghost is absent to increase background contrast. Having an independently operated flash able to be used as and when required would greatly ease creating desired effects. If camera controlled std flash is used then (usual) front curtain synchronised flash will lead to trails in front of the ghost and rear curtain flash will lead to trails behind the ghost.
In the images below various effects are noted. Some of these were intentional and some were happenstance. Ghost shooting often requires both trail and error AND intelligent planning and analysis of what you see and why to achieve a desired effect. The various effects on the left hand character in the right half of the final image below [I resemble that] were largely not planned and some were somewhat unexpected (eg variations in shirt transperancy and variation in 'tatoo' effects on arms. While these are obviously explicable in terms of relative lighting levels, being aware that such things happen will (hopefully) help in achieving the desired effects.
The image below demonstrates some of these concepts and also shows some potential problems which need to be addressed. This was taken at ISO100 f/3.5, 15 seconds with no flash. It can be seen that the smoothness of motion of the moving ghost affects how distinct the character is. If the left hand character had walked slowly across the scene, paused for say 20% of the time at some point and then walked on, you'd have both a trail and a distinct ghost. If the pause was at the last portion of the exposure you'd have a trail leading up to the ghost.
For 'extra points' and with enough exposure time a single ghost could run from point to point and then pause at various points (rock steady ptm] of course and then more on. Slow motion would leave a trail between several more distinct ghosts. Fast motion would leave no trail (see sitting ghosts).
Ghosts of Escondido. Larger version here
The two sitting 'ghosts' simply stood up and walked away part way through the exposure. Do this rapidly enough and it is not obvious that the 'ghost' has moved. I've had a peer at the larger version and there is no readily apparent image from the departing ghosts.
The ghost at left simply moved slightly in a series of 'jerks' during the exposure - steady motion would leave a blur.
Closer-up of 3 seated figures. Figure at right is NOT a ghost but relative lighting has washed out contrast. Ghostiness" can be adjusted by percent of time that ghost is present.
I'm the right hand of the two seated ghosts.
Ghost with flash
This is a 2 second exposure with rear curtain flash.
The Police car almost didn't get included (when the flash is synced to a long shutter speed it tales luck and practice to get things right).
They didn't come back :-)
The top portion is a blowup of the left hand middle edge.
Larger version here
Walking Ghost, rear curtain flash
My excuse for looking like that is it's 2:40am in a cold wet winter morning :-).
4 seconds, f/5.,6, ISO 100, rear curtain sync.
No obvious ghost motion.
Note car tail-light - a ghost vehicle has transited the picture but left no impression of the actual car.
Service station lighting serves to vary the degree of ghostliness.
Flash at end of frame highlights ghost.
Larger versioin hgere
Without a flash the ghost is almost unseen in the same conditions (at far right)
Here the ghost has moved slowly enough toi leave a atrail behgind, but the effectis hardly pleasing. More frontr lighting would make the moving ghost more distinct relative to the background and make the trail more solid for a given speed of movement.
Note the dotted lines of right at rear - these are from indicators od cars turning into (out of) the street behind. They were not driving on the grass despite appearances.
Background / foreground lighting:
The variation between background and foreground at each point in the picture can make an immense difference to what is seen. Image below is 1.5 seconds, f/16, ISo 400 in each case.
In the left half image below the left side of the left hand character has (not surprisingly) no apparent ghost effect as the flash lit character is set off against an essentially black background. The rh side of the character is nicely ghosted in the white shirt area while the black trousers essentially vanish due to the illuminated doorpanels behind. The young woman has variable bands of ghostly effect with a "running man" fire exit logo tastefully stamped on her head (there's no accounting for what ghosts will do)
and various other light / dark and dark / light combinations leading to a range of effects.
In the right half image the left side character (which happens to be me) displays a range of interesting variations. The shirt which is flash illuminated varies from almost wholly opaque to about 50% transparent in a manner which is non-intuitive and the carpet pattern tattoos on the arms are seen through the arm (left of image) and on the arm (right of image).