There are two forces that can cause the formation of a tail: the solar wind and radiation pressure.
The first misconception in your question is "the dust [travels] slower than the nucleus". The tail is not left trailing behind the comet, it is pushed away from the comet by the sun. When the comet is moving away from the sun, the tail is in front of the comet.
Now radiation pressure is small but real. When light shines on something there is a small force. This pushes dust back from the comet in the direction opposite to the sun. The dust is still affected by gravity and a curved dust tail results.
The ultraviolet light from the Sun ionises the gas and gives it an electric charge. The solar wind carries magnetic fields and the gas (or more properly plasma) follows these fields in a straight line back from the sun.
So space around the Sun is not empty. There is powerful light and magnetic fields that are strong enough to push the dust and gas released by the comet away from the coma, and form the tail.