Okay, I'm going to assume that you've been taught that if you fire a projectile horizontally, it will always follow a parabolic path until it hits the ground. This actually isn't true, because it assumes that the Earth is flat and that the force of gravity always acts in a direction perpendicular to the flat surface.
The Earth isn't flat however, and the force of gravity always points to the center of the Earth. The result is that the projectile actually follows an elliptical path, with the center of the Earth at one focus of the ellipse. (Except for the cases where the projectile is fired at or above escape velocity, in which it will take a parabolic or hyberbolic tracjectory with the center of the Earth at the focus)
As the speed at which the projectile is fired increases, the eccentricity of the ellipse changes until it equals 0, at which point, the trajectory becomes a circle (which is a special case of ellipse.) and you have acheived a circular orbit. If the projectile is fird at even a higher speed, the trajectory becomes more elliptical course, but one where it climbs away from the Earth and then returns to its original point, then repeats. It enters an elliptical orbit with a perigee at the original launch point.
All objects following ballistic paths with respect to a central gravitational body wil follow these types of trajectories. Comets follow either ellipitic or hyperbolic trajectories. If the perihelion (closest approach to the Sun's center) is outside the Sun's surface, the comet will miss the Sun on the close approach and head back out into space. (Some comets do strike the Sun, as there trajectories intersect the surface).