On the rare occasions where the numbers in a division are equal, the Speaker, who does not otherwise vote, has the casting vote.
The Speaker is entitled to vote according to conscience, but to keep up the tradition of impartiality normally does so in line with a set of principles and precedents recorded in Erskine May (the guide to Parliamentary practice and procedure).
The Speaker's casting vote is not often required. The most recent example was during the Maastricht debate in 1993 when the Speaker voted with the government in accordance with the above guidelines.
The same principle applies when a bill is passing its committee stage in the Commons as a committee of the whole House; committee stage chairmen, appointed by the Speaker, have the casting vote when a vote on an amendment is tied.
In contrast to the Commons, neither the Lord Speaker nor one of their deputies has the power of a casting vote in the upper chamber.