Gravity in vector We know that gravity is a force. But what is it's direction? Can it be expressed by vector and how can we do that? This question can also be asked for Coulomb's Law.
 A: Imagine you have only two masses in the universe $M$ and $m$, then the gravitational force that $m$ feels due to $M$ is indeed a vector that points towards $M$. This is called a central force, and as you point out Coulomb's force also behaves like that.
If you add another mass $M'$ into the picture the problem becomes more complex, in the sense that $m$ will feel now two forces: one pointing towards $M$ (${\bf F}$) and the other one pointing to $M'$ (${\bf F}'$). The resulting force ${\bf F} + {\bf F}'$ is also a vector but not necessarily point in any particular direction 
A: If we use the centre of the earth as origin, we have
$$\mathbf{F}=-\frac{GM_{\oplus}m}{r^3}\mathbf{r} \tag{$r>R_{\oplus}$}$$
where $\mathbf{r}=(x,y,z)$ and $\displaystyle \left| \frac{\mathbf{r}}{r^3} \right|=\frac{1}{r^2}$.
At the surface of the earth,
$$g=\frac{GM_{\oplus}}{R_{\oplus}^2} \approx 9.8 \text{ m s}^{-2}$$
where $M_{\oplus}$ and $R_{\oplus}$ is the mass and radius of the earth respectively.

We assume the earth and the test mass have spherical symmetry in their densities.

The Columb's law version is
$$\mathbf{F}=\frac{Q_1 Q_2}{4\pi \epsilon_0 r^3}\mathbf{r}$$
assuming point charges or negligible electrostatic induction.
See another answer with electrostatic induction here.
A: As a first statement, I like to begin by stating that gravity is always towards the mass (e.g. always attractive). In other words, if mass A pulls on mass B, I would state that the direction of the gravitational force is towards mass A. If you set up coordinate system, you may then put this in by hand. (The same line of reasoning applies to the coulomb force, except now the direction of the force may be either toward or away depending on the signs of the charges.)
If we wish to be more formal, we can set up a spherical coordinate system centred on mass A. The direction of the gravitational force on mass B will always be in the $-\hat{r}$ direction, where $\vec{r}$ is a vector that describes the location of mass B.
