Codonopsis pilosula is a traditional Chinese tonic herb commonly used as food and medicine, particularly for the treatment of spleen deficiency syndrome. However, the specific bioactive components responsible for C. pilosula effects remain unclear, and their distribution in the root of C. pilosula has not been fully elucidated due to the lack of efficient analytical techniques. In this work, we combined metabolomics with serum pharmacochemistry to investigate C. pilosula effects in a rat model of spleen deficiency syndrome. Pearson correlative analysis was applied to discover that 8 chemical compounds, including lobetyolin, atractylenolide III, syringin, luteolin, asperuloside, O-acetyl-L-serine, L-citrulline and creatine, were significantly correlated with biomarkers and considered as potential pharmacodynamic basis of C. pilosula. Furthermore, matrix-assisted laser desorption/ionization mass spectrometry imaging (MALDI-MSI) was performed to visualize the spatial distribution of the bioactive substances in the root of C. pilosula. L-citrulline was widely distributed in roots. The content of atractylenolide III and luteolin in the cortex and xylem was much higher than that in the phloem. O-Acetyl-L-serine was present in the entire phloem and a small portion of the xylem. Creatine, lobetyolin, asperuloside, and syringin were mostly distributed in the peridermal cortex, and their contents were low. By integrating metabolomics, serum pharmacochemistry and MALDI-MSI, our proposed analytical method elucidated the material basis of C. pilosula and figured out their spatial distribution in the root of C. pilosula, which provides new insights for improving the quality of medicinal herbs.