Answer:
Vx' = (Vx - u) / (1 - Vx *u / c^2) velocity transformation formula
In both cases we wish to measure the velocity in the frame of the earth which is moving at speed u = -.99 c relative to the spaceship
VA' = (c + .99c) / (1 - (-.99 c * c) / c^2) = 1.99c / 1.99 = c
VB' = (-c + .99c) / (1 - (-c * -.99c) / c^2) = .01 c / .01 = c
In both cases an observer on earth will observe the light traveling at speed c.