A phased array usually suffers from severe gain drop when its beam steers in a wide range. In this article, an alleviating technique based on a gain-compensating approach is proposed. Isolated element pattern (IEP) and array factor are jointly considered. When calculating the array factor, mutual couplings between antennas in an array are also included. The IEP is optimized in such a way that the element gain is nearly inversely proportional to the peak gain of the array factor. As a result, the peak gain of the overall array beam can be kept almost the same in a wide scanning range. As an example, a cylindrical dielectric resonator antenna (DRA) array is investigated. In such a design, a dip is introduced to the top of the element pattern so that the top peak in the array factor envelope can be compensated. This idea is demonstrated by using an X-band cylindrical DRA, with its beam shaped by using a loading peripheral metal ring and two top dielectric slabs. This shaped-beam DRA element is used to construct a nine-element H-plane linear phased array. The element and array prototypes were fabricated and measured, and reasonable agreement between the measured and simulated results is observed. The measured 3-dB beamwidths of the DRA element are 172° and 149° in the E- and H-planes, respectively. It is found that the H-plane main beam of the DRA array can scan from <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$- \mathrm{72}^{\circ }$ </tex-math></inline-formula> to <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$+ \mathrm{72}^{\circ }$ </tex-math></inline-formula> with a small gain fluctuation of less than 0.9 dB.