Being able to support various aspect ratios and resolutions typically comes down to three things:
1: Determine the minimum resolution you want your game to look proper at and ensure that your graphics will scale up from that resolution properly. Typically, make your graphics bigger than they need to be and scale them down using matrix transformations. 640x480 is a typical minimum resolution and works well for scaling purposes.
2. Don't scale things by the exact difference from your target resolution, scale by increments. Try to directly support 640x480, 960x720 and 1280x960 with your scaling system. If you can hit those without incident then all other aspect ratios should work out OK. Also remember to only use a single axis to determine the scaling. (IE: If the resolution is set to portrait, such as 1080x1920, this isn't wide enough to support the same scaling factor 1280x960 could handle.)
3. Your ultimate graphical design needs to be fluid. GUI elements have to be able to centre and move around the edges of the screen based on how big they've been scaled and how much space they have. Remember to design with the minimum resolution in mind.
That is the standard approach but there's one other worth mentioning: When dealing with low-resoltion graphics, like 320x240, scale this up to a high fixed resoltuion first using nearest-neighbour filtering, like 1280x960, then draw that to perfectly fit the screen using linear filtering. It's extremely hard to notice the aliasing between the pixels when you do this, allowing your low-res game to run at the native resolution of whatever the target system is. You probably need to add black bars though for different aspect ratios or have the ability to change your low-res aspect ratio with fluid methodology.