The structure and kinematics of the gas around galaxies are crucial for understanding the multiphase flows within the galactic ecosystem and, thus, galaxy evolution and star formation as a whole. Traditionally, insights into the structure of the circumgalactic medium (CGM) have been investigated through absorption line studies. Recent advancements in instruments and techniques, however, offer a new perspective on gas flows around galaxies through emission features of resonance lines, such as Hydrogen Lyman-α (Lyα at 1215.67 Å), and metal resonance lines, such as Mg II λλ2796, 2803, C IV λλ1548, 1551, O VI λλ1032, 1038. These resonance lines act as coolants of shocked gas by collisional excitation and ionized gas by recombination. Furthermore, due to their resonance nature, the physical properties of scattering regions are imprinted on their observables. For example, Lyα emission includes the information of the H II region intrinsically and the H I region through scatterings. Other metal resonance lines also carry the properties of emission and scattering regions. In particular, the Mg II resonance line has emerged as a promising tracer of cold gas at T ~ 10^4 K like Lyα. To decode the message in their observations, I have developed a 3D Monte-Carlo radiative transfer code ‘RT-scat’. In this talk, I will introduce the CGM and the radiative transfer of resonance lines. I will also present how Mg II emission lines form in various environments, including inflowing/outflowing. Furthermore, I will discuss how to explore cold gas properties through observations of Mg II resonance lines. If time allows, I will also discuss other UV metal resonance lines as tracers of multiphase gas.