Shape comparing technologies based on Gaussian functions have been widely used in virtual screening of drug discovery. For efficiency, most of them adopt the First Order Gaussian Approximation (FOGA), in which the shape density of a molecule is represented as a simple sum of all individual atomic shape densities. In the current work, the effectiveness and error in shape similarity calculated by such an approximation are carefully analyzed. A new approach, which is called the Weighted Gaussian Algorithm (WEGA), is proposed to improve the accuracy of the first order approximation. The new approach significantly improves the accuracy of molecular volumes and reduces the error of shape similarity calculations by 37% using the hard-sphere model as the reference. The new algorithm also keeps the simplicity and efficiency of the FOGA. A program based on the new method has been implemented for molecular overlay and shape-based virtual screening. With improved accuracy for shape similarity scores, the new algorithm also improves virtual screening results, particularly when a shape-feature combo scoring function is used.