Due to the ejection phenomenon, a high-velocity encounter of a meteoroid or a space debris particle with a spacecraft surface produces the ejecta particles, which may represent a danger to exterior equipments of the spacecraft (the antennae, solar batteries, etc). Nowadays, the ejecta particles are considered as one of the main sources of the near-Earth space pollution that justifies an interest to their study. The main parameters characterizing the ejecta are the angles of their ejection with respect to the surface of the target, the spatial distribution by mass, size, velocity. In the present paper we consider analytically the problem of penetrating a rigid projectile into an infinite target in order to determine the dependence of the output angles of the ejecta particles (the ejection angles) on the penetration depth of the projectile. The problem is considered under the assumption of a plane deformed state of the target material. To describe the mechanical properties of the target, the hypothesis of incompressibility and ideal plasticity is adopted. On the basis of the energy balance, the equation of motion (penetration) of the projectile is obtained. The ejection angles are determined from the condition of minimum power of internal forces. In the case of a compact-projectile penetration (the penetration depth in units of transverse dimension is h ≈2¸3), the ejection angles are about 65-67 degrees, which corresponds to the known experimental data. In the case of a rod, for large values of the penetration depth h >>1, the ejection angle varies slightly with increasing h . For example, at h ≈10-20, it is approximately 72-75 degrees.