Explanation
Cohesion is the force that causes the like molecules stick together while adhesion is the force which causes the unlike molecules to cling. Since the cohesive force among mercury molecules is stronger than the adhesive force among mercury and glass molecules, it acquires spherical shape.