A theory of discrete VLF emissions from the magnetosphere