Microbial communities are pivotal in aquatic ecosystems, as they affect water quality, energy dynamics, nutrient cycling, and hydrological stability. This study explored the effects of rainfall on hydrological and photosynthetic parameters, microbial composition, and functional gene profiles in the Fen River. Our results demonstrated that rainfall-induced decreases in stream temperature, dissolved oxygen, pH, total phosphorus, chemical oxygen demand, and dissolved organic carbon concentrations. In contrast, rainfall increased total dissolved solids, salinity, and ammonia-nitrogen concentrations. A detailed microbial community structure analysis revealed that Cyanobacteria was the dominant microbial taxon in the Fen River, accounting for approximately 75% and 25% of the microalgal and bacterial communities, respectively. The abundance of Chlorophyta and Bacillariophyta increased by 47.66% and 29.92%, respectively, whereas the relative abundance of Bacteroidetes decreased by 37.55% under rainfall conditions. Stochastic processes predominantly affected the assembly of the bacterial community on rainy days. Functional gene analysis revealed variations in bacterial functions between sunny (Sun) and rainy (Rain) conditions, particularly in genes associated with the carbon cycle. The 3-oxoacyl-[acyl-carrier-protein] reductase gene was more abundant in the Fen River bacterial community. Particular genes involved in metabolism and environmental information processing, including the acetyl-CoA C-acetyltransferase (atoB), enoyl-CoA hydratase (paaF), and branched-chain amino acid transport system gene (livK), which are integral to environmental information processing, were more abundant in Sun than the Rain conditions. In contrast, the phosphate transport system gene, the galactose metabolic gene, and the pyruvate metabolic gene were more abundant in Rain. The excitation-emission matrix analysis with parallel factor analysis identified four fluorescence components (C1–C4) in the river, which were predominantly protein- (C1) and humic-like (C2–C4) substances. Rainfall affected organic matter production and transport, leading to changes in the degradation and stability of dissolved organic matter. Overall, this study offers insight into how rainfall affects aquatic ecosystems.