Maximum Speed
Gravity from the sun causes a comet to accelerate toward it. Since the farthest point of its orbit is more than a billion miles away, the trip toward the sun takes anywhere from decades to thousands of years. Although the speeds of different comets vary, at their fastest, they can reach speeds of 100 miles per second. This lasts only a few days; as a comet's orbit takes it back out of the solar system, it slows down.
Perihelion
A comet reaches its maximum speed at a point called perihelion -- the point in its orbit where it's closest to the sun. Comets do not strike the sun, but follow a path that can be anywhere from a few thousand to a few million miles away from it. This is similar to the motion of a skateboarder in a half-pipe: his speed is slowest at the top, he picks up speed as he heads downs the slope, he reaches his fastest speed at the bottom then, as he goes up the other side, he slows down.
Tail Formation
Far from the sun, in the cold of space, a comet has no tail. As it approaches the sun and gathers speed, the sun's heat warms the comet. Methane, carbon dioxide and water ice turn to vapor, reflecting sunlight and forming the tail. The tail always points away from the sun, blown in that direction by particles called the solar wind. As a comet rounds the sun and heads back to the outer solar system, the tail appears backward -- no longer trailing the comet but, rather, pointing ahead of it.
Kepler's Second Law
The orbital speed of planets and comets follow Kepler's Second Law. As they move in their orbit, they sweep out imaginary wedges of space between them and the sun. For every equal measure of time, the wedges form equal areas. Far out from the sun, as they move slowly, the wedges are long and thin. Close to the sun, as they move faster, the wedges are thick and short. In all cases, the wedge areas are the same.