Lambertian shading illuminates all the front of a sphere
I think there is a problem with your ray-sphere intersection.
It should go like this
sphere_normal = ray.origin - sphere_center;
b = dot(sphere_normal , ray.normalized_dir);
c = dot(sphere_normal , sphere_normal ) - sphere_radius*spheres_radius;
float disc = b * b - c;

float t = -1.0f;
if(disc &gt;= 0.0f)
t = -b +- sqrt(disc);

if(t &gt;= 0) // means ray intersects...
     

Check out scratchapixel to understand how I got this.
https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-sphere-intersection