Condensation of 4-methyl-7-hydroxypyrano[2,3-b]pyridin-2-one (I) with N,N-dimethylthiocarbamoyl chloride gives the thiocarbamate (II), which undergoes thermal rearrangement at 220 C to the S-aryl thiocarbamate isomer (III). Subsequent alkaline hydrolysis of (III) provides the 7-mercapto azacoumarin (IV). Alkylation of (IV) with chloroacetone (V) affords thioether (VI). This compound is finally cyclized to the target pyranothienopyridine compound under alkaline conditions.