The silk gland synthesizes and secretes a large amount of protein and stores liquid silk protein at an extremely high concentration. Interestingly, silk proteins and serine protease inhibitors are orderly arranged in the silk gland lumen and cocoon shells. Silk fiber formation and the spinning mechanism have not been fully elucidated. Therefore, we conducted a comparative transcriptome analysis of seven segments of the single silk gland to characterize internal changes in the silk gland during the 5th instar of mature larvae. In total, 3121 differentially expressed genes were identified in the seven segments. Genes highly expressed in the middle silk gland (MSG) were mainly involved in unsaturated fatty acid biosynthesis, fatty acid metabolism, apoptosis—fly, and lysosome pathways, whereas genes highly expressed in the posterior silk gland (PSG) were mainly involved in ribosome, proteasome, citrate cycle, and glycolysis/gluconeogenesis pathways. Thus, the MSG and PSG differ greatly in energy source use and function. Further, 773 gradually upregulated genes (from PSG to MSG) were involved in energy metabolism, silk protein synthesis, and secretion, suggesting that these genes play an important role in silk fiber formation. Our findings provide insights into the mechanism of silk protein synthesis and transport and silk fiber formation.