Question in do Carmo's book Riemannian geometry section 7 I have a question. Please help me.

Assume that $M$ is complete and noncompact, and let $p$ belong to $M$. 
  Show that $M$ contains a ray starting from $p$.

$M$ is a riemannian manifold. It is geodesically and Cauchy sequences complete too. A ray is a geodesic curve that its domain is $[0,\infty)$ and it minimizes the distance between start point to each other points of curve. 
 A: (This is more of a comment to Mikhail's perfectly fine answer, but it got too long.)
I just wanted to append a proof that your suggested $\gamma$ really does work.
To be more explicit, we assume $d(x_i, p) \geq i$ and that each $\gamma_i(t) = \exp_p(t\gamma_i'(0))$ (which connects $p$ to $x_i$) is unit speed.  Since the unit sphere in $T_p M$ is compact, the sequence $\{\gamma_i'(0)\}$ must have some convergent subsequence, say, with limit $v$.  I will abuse notation and use $\gamma_i'(0)$ to refer to this subsequence.  Set $\gamma(t) = \exp_p(tv)$.
Lemma:  For any fixed $t$, we have $\lim_{i\rightarrow \infty} d(\gamma(t), \gamma_i(t)) = 0$.
Proof:  Because $d$ and $\exp_p$ are continuous, $$\lim_{i\rightarrow \infty} d(\gamma(t),\gamma_i(t)) = d(\gamma(t), \exp_p(\lim_{i\rightarrow\infty} t\gamma_i'(0))) = d(\gamma(t), \gamma(t)) = 0.$$ $\square$
Now, assume for a contradiction that there is some time $t$ for which $\gamma(t)$ is not minimizing.  That is, assume there is a $t>0$ for which $d(p, \gamma(t)) < t$.
For any $i > t$, we know $d(\gamma_i(t), p) = t$.  From the lemma, we know that there is an $I$ with the property that for all $i > I$, $d(\gamma_i(t), \gamma(t)) < t -d(\gamma(t), p)$.
Then, for any $i \geq \max\{t,I\}$, the triangle inequality gives $$t = d(\gamma_i(t), p) \leq d(\gamma_i(t), \gamma(t)) + d(\gamma(t),p) < t - d(\gamma(t), p) + d(\gamma(t), p) = t$$ which gives a contradiction.
A: Otherwise suppose every geodesic emitting from p will fail to be a segment after some distance s. Since the unit sphere in the tangent plane that parameterizing these geodesics is compact, s has a maximum $s_{max}$. This means that the farthest distance from p is $s_{max}$, among all points of the manifold. So the diameter of the manifold is bounded by $2s_{max}$, by the triangle inequality. So the manifold is bounded and complete, by the Hopf–Rinow theorem, it is then compact.
A: Take a sequence of points $(x_i)$ in the manifold whose distance from $p$ tends to infinity, and connect each of them to $p$ by a minimizing geodesic $\gamma_i(s)$.  Choose a convergent subsequence $\gamma'_{i_k}(0)$ at $p$.  Then the limit of the sequence is the desired direction of a ray.
