I understand that the solid gas coating the nucleus of a comet is melted and that this gas is ionised by the UV rays from the sun. This makes the gas particles charged.
What I dont understand is why they are always pointing away from the sun. I agree that they would be affected by magnetic fields, however I dont see why this means they follow a path away from the sun. Magnetic fields provide a force perpendicular to the direction of motion, not a long it. I've seen several explanations on other websites where they give a vague description as the gas is being carried by the solar winds along the suns magentic field lines, but I dont understand how this is possible.
Can someone please clarify why the ion tail of a comet always points away from the sun?