Let us calculate as vector g at point due to a point mass M.
For this we imagine a test mass m0 put at P. Then we write force using vector F using Newton’slaw of gravitation.

The minus sign shows that is vector g is directed towards the source mass M.