Relativistic astrometry has recently become an active field of research owing to new observational technologies which allow for accuracies of a microarcsecond. To assure this accuracy in data analysis, one has to perform ray tracing in a general relativistic framework including terms of the order of (v/c)(3) in the weak field treatment of Einstein equations applied to the solar system. Basic to the solution of a ray tracing problem are the boundary conditions that one has to fix from the observational data. In this paper we solve this problem to (v/c)(3) in a fully analytical way.