How do RAM and processor speed affect overall performance on Android? Since Android can be installed on wide range of devices, I'm wondering how important RAM and the CPU speed are to the performance of a device.  There are always tradeoffs when something is increased and another one decreased!

Is more RAM or a faster processor better for general browsing and less mulititasking?  What if I'm interested in gaming or doing lots of things at once?  Will more RAM make up for a slower processor or vice-versa?
In the context of Android, more RAM means Android can keep more sleeping program in the RAM so they will be ready to be quickly resumed when you return back to the apps. More RAM means Android is going to spend less of its time killing and reloading apps from the internal memory/sd card, and instead spend more time doing actual work you care about. This means that more RAM usually give you better/faster task-switching. Also, more RAM means your homescreen is less likely to be killed; and you won't experience that 10-second-wait-that-feels-like-forever. Having more RAM also allows you to run complex apps that naturally requires a lot of memory, e.g. photo/video editor, complex games, etc.
A higher CPU is able to calculate things much faster, while this might look tempting at first, it is notable that most programs -- except for games and synthetic benchmark and possibly flash-heavy webpages -- are I/O-bound and not CPU-bound; in other word, most programs are waiting for network transmission, flash storage reads, DMA reads, touch event processing, etc to finish, instead of waiting for some calculations. In CPU-bound application, increasing CPU speed can mean less latency between touching the screen and the screen updating to reflect the touch event. However, up to a certain point, there will be no longer any noticeable benefit of adding even more CPU; beyond a certain point, the input turnaround will be much faster than our own brain's turnaround time (approx. 100-200ms) and we will not be able to perceive the benefit of adding even faster CPU. Also, note that input-to-output turnaround time depends on a large number of other factors, e.g. the latency of the cables, speed of the bus, etc. Second, having some extra CPU time to spare also means that Android can assign those spare CPU cycles to background processes, so background processes can run better.
Summary
More RAM:

better task-switching
can run more complicated apps or open larger/more complex files

More CPU:

faster turnaround between input and response (less lag) on CPU-bound apps
better background processing

In short, both are equally important; your own personal usage pattern will determine which is more valuable for you. If you generally stays in a single program and is sensitive to input-to-output latency then having faster CPU will be more valuable for you; if you constantly task switch between many different apps or if you need to run complex memory-hungry apps to open complex large files, then having extra RAM is going to be more valuable to you.