Right, Peking is the old spelling, pronounced pei-ching. After the introduction of pin-yin (the new transcribing system - based on the Roman alphabet), the spelling became Beijing. Both the old and new spelling are approximations of the Chinese sound, pronounced something like "pay-cheeng." Peking or Beijing (northern capital, bei = north and jing = capital).
Read more here ...
Why was "p" changed to "b", and "k" ([ch]) changed to "j"?
There are many different systems for representing the sounds of standard Mandarin in the Latin alphabet. The system used most often (at least up until recently) is the Wade-Giles system (WG).
WG is the system that uses a p for what sounds to most English speakers like a b, e.g. the capital city of Taiwan is written Taipei instead of Taibei. In fact, Taipei should actually be written T'ai-pei in WG; this system marks aspirated stops in Mandarin by adding an apostrophe ' after the symbol(s) for the unaspirated stop. This is supposedly to remind us that the main contrast between these two Chinese stops is not voiced vs. unvoiced, as it theoretically is in English, but unaspirated and aspirated.
However, the 'voiced' English stops (b in boy, d in dog, and g in go) are in practice not usually voiced either, when they occur initially in a word (they are voiced when they come after a vowel, like the b in about). So that makes the p, p' t, t' k, k' system very confusing for speakers who use a Romanized alphabet. Peiching => Beijing
Hope that helps.