Answer:
Speed of the spacecraft right before the collision:  .
. 
Assumption: the earth is exactly spherical with a uniform density.
Explanation:
This question could be solved using the conservation of energy.
The mechanical energy of this spacecraft is the sum of:
- the kinetic energy of this spacecraft, and
- the (gravitational) potential energy of this spacecraft. 
Let  denote the mass of this spacecraft. At a distance of
 denote the mass of this spacecraft. At a distance of  from the center of the earth (with mass
 from the center of the earth (with mass  ), the gravitational potential energy (
), the gravitational potential energy ( ) of this spacecraft would be:
) of this spacecraft would be:
 .
.
Initially,  (the denominator of this fraction) is infinitely large. Therefore, the initial value of
 (the denominator of this fraction) is infinitely large. Therefore, the initial value of  will be infinitely close to zero.
 will be infinitely close to zero. 
On the other hand, the question states that the initial kinetic energy ( ) of this spacecraft is also zero. Therefore, the initial mechanical energy of this spacecraft would be zero.
) of this spacecraft is also zero. Therefore, the initial mechanical energy of this spacecraft would be zero.
Right before the collision, the spacecraft would be very close to the surface of the earth. The distance  between the spacecraft and the center of the earth would be approximately equal to
 between the spacecraft and the center of the earth would be approximately equal to  , the radius of the earth.
, the radius of the earth.
The  of the spacecraft at that moment would be:
 of the spacecraft at that moment would be:
 .
.
Subtract this value from zero to find the loss in the  of this spacecraft:
 of this spacecraft:

Assume that gravitational pull is the only force on the spacecraft. The size of the loss in the  of this spacecraft would be equal to the size of the gain in its
 of this spacecraft would be equal to the size of the gain in its  .
. 
Therefore, right before collision, the  of this spacecraft would be:
 of this spacecraft would be:
 .
.
On the other hand, let  denote the speed of this spacecraft. The following equation that relates
 denote the speed of this spacecraft. The following equation that relates  and
 and  to
 to  :
:
 .
.
Rearrange this equation to find an equation for  :
:
 .
.
It is already found that right before the collision,  . Make use of this equation to find
. Make use of this equation to find  at that moment:
 at that moment:
 .
.