A method is described for the preparation of 2-substituted furo[2,3-b]pyrazines (1) and thieno[2,3-b]pyrazines (2) by ring closure of the 1,4-diketones 7 (X = Y = O) and 1,4-oxothiones 7 (X,Y = O,S). The requisite (thio)carbonyl compounds were obtained by reaction of esters and thiono esters with lithium salts of dianions, prepared from 3-methyl-2-pyrazone (3, X = O) and 3-methyl-2-pyrazinethione (3, X = S), respectively. The scope of these condensation and cyclisation reactions is discussed.