RAM is the least important, provided you have at least 8 GB of DDR3 1600mhz for modern games. RAM is like a highway, determining if you can have 2 lanes, 4 lanes, or more of "cars" (data volume) going to and from other parts of your PC (such as GPU and CPU).
From there, some games are more CPU dependent, others are more GPU dependent. Historically, most games cannot maximize more than 2 cores during games, but there are exceptions to that rule. The reason I mention it is because it's more important to have a quad core CPU with faster cores, than it is to have a CPU with 8 cores with slower cores. It is a misconception that more cores = better.
Provided your PC is not bottlenecked by your CPU, your GPU is the single most important part in your PC for gaming. This is usually the most expensive part in your gaming PC, and for good reason.
In summary, your PC will be only as fast as the slowest part in your PC. My minimum recommendations currently are:
8gb DDR3 1600mhz
i5 CPU, preferably one around 3.4 GHZ or more. If you are into overclocking you can get to 4.0 ghz or more easily with a decent cooler.
Depending on your screen resolution and games you play, a graphics card good enough for your needs. The GTX 970 is a good buy right now as you can max almost all modern games on 1080p. If you are running high resolution (4k) or multiple monitors, you may want to consider a GTX 980, or a sli configuration of some fashion. On the mid/lower end, the radeon R9 280 and R9 290 are great buys right now and run more than fast enough for most games.