Bubbles in pipes are widely present in marine engineering, transmission, and fluid systems with complex environments. This paper divides tubes into short, longer, and long tubes due to different lengths. In short tubes, the formation, development, and stability of spark bubbles are deeply analyzed through numerical simulation and experimental measurement, and the morphology and period of vortex rings generated in the surrounding fluid are studied. The results show that bubbles in tubes are significantly elongated compared with those in free fields. Changing the parameters of tubes can affect the size and oscillation speed of vortex rings. Secondary cavitation is found in asymmetric positions in longer tubes. The conditions, positions, and periods of multiple secondary cavitations are summarized in a series of experiments on long tubes. It is found that bubbles in tubes are related to the gamma t and gamma L tube parameters. More secondary cavitation is easily generated in thinner and longer tubes. In addition, the pumping effect brought about by the movement of bubbles in tubes is studied. By designing reasonable tube parameters, the life cycle of bubbles can be changed, and the pumping efficiency can be improved. This study provides important theoretical support for the reliability of the movement of bubbles and surrounding fluid in tubes and lays a foundation for the optimization and promotion of this technology in practical applications.