How to object rotate on a single axis towards another object? C#

I have an object A in a 3D world (ortho view). I want object A to rotate along the X axis to face object B. Object A must not change on the y and z axis.

Visual Aid: http://i.imgur.com/6VsBfGE.png - spaceship lies at a point with rotation 0, -90, 90. It must face the planet with the front of the ship, like this: http://i.imgur.com/cE94rlI.png

I’ve tried a whole range of things from other threads but can’t get it working. Unity v5.5

Wold a Quaternion.setfromtorotation work for you? So it would be kinda lige this:

public float speed;
    void Update() {
        float step = speed * Time.deltaTime;
        transform.rotation = Quaternion.RotateTowards(A.rotation, Quaternion.setfromtorotation(A.Forwards, (B. Transform - A.Transform) ) , step);
    }

Not sure ifølge A.forward is valid, but should work othervise, the B - A Thing is just to Construct Vector from A pointing towards B

So I knew I was complicating things far too much. So I took it down to the basics. This is my problem in its simplest form: http://i.imgur.com/ImcmpxQ.png

From the positions we can calculate the sides of the triangle with the code

float z = Vector3.Distance(objectB.transform.position, objectA.transform.position);
float x = objectB.transform.position.x - objectA.transform.position.x;
float y = objectB.transform.position.y - objectB.transform.position.y;

then we use the equation [1] to calculate the angle:
float angle = Mathf.Acos((Mathf.Pow(y, 2.0f) + Mathf.Pow(z, 2.0f) - Mathf.Pow(x, 2.0f) / 2 * y * z));
BUT [Mathf.Acos][2] gives the number back in Radiants. So to convert to Degrees do:
angle *= Mathf.Rad2Deg;
However, if we were to put this into Rotate() right now, it would rotate the wrong way if ObjectB is on the right side of ObjectA, so we have to make the angle a negative if it is on the right hand side (ie if x position of ObjectB is larger than ObjectA’s)
if (x > 0)
angle = -angle;
then finally, put this angle into the simple Rotate() function, rotating on the x axis
objectA.transform.Rotate(Vector3.forward, angle);
Here is the thing in its entirety for easy copy and pasting for anyone looking this up:
float z = Vector3.Distance(objectB.transform.position, objectA.transform.position);
float x = objectB.transform.position.x - objectA.transform.position.x;
float y = objectB.transform.position.y - objectB.transform.position.y;
float angle = Mathf.Acos((Mathf.Pow(y, 2.0f) + Mathf.Pow(z, 2.0f) - Mathf.Pow(x, 2.0f) / 2 * y * z));
angle *= Mathf.Rad2Deg;
if (x > 0)
angle = -angle;
objectA.transform.Rotate(Vector3.forward, angle);
[1]: Triangle Calculator
[2]: Unity - Scripting API: Mathf.Acos

transform.rotation = Quaternion.LookRotation(Vector3.forward, target.transform.position);