The flaming sphere of fire from the flaming sphere spell is only 5 feet wide. So on a grid with 5 foot-foot squares, it would effectaffect a 3×3 area, with the sphere in the middle square. For ramming, the spell specifically says:
If you ram the sphere into a creature, that creature must make the saving throw against the sphere’s damage, and the sphere stops moving this turn.
This means you use your command of the sphere to move it directly into a creaturescreature's space (thereby hitting it) and they have to make a normal Dex save, and if the sphere hits the target before moving its full 30 feet you lose the rest of the move distance.