VSEPR THEORY
The Lewis structure of a molecule tells us the number of pairs of electrons in the valence shell of the central atom.
These electron pairs are subject to electrostatic attractions between them.
On this basis, R.G.Gillespie (1970) proposed a theory called the Valence-Shell Electron Pair Repulsion or VSEPR (pronounced as 'Vesper') theory.
It states that :
The electron pairs (both lone pairs and shared pairs), surrounding the central atom will be arranged in space as far apart as possible to minimise the electrostatic repulsion between them.

Shape or Structure of BeCl2 - Linear Geometry
Beryllium chloride, BeCl2. It has the Lewis structure with the central atom Be has two bonding electron pairs and no unshared electron.
According to VSEPR theory, the bonding pairs will occupy positions on opposite sides of Be forming an angle of 180º.

An angle of 180º gives a straight line.
Therefore, BeCl2 molecule is linear.
In general, all molecules as A–B–A which have only two bonds and no unshared electrons are linear.
