In networking we share File(Disk Driver) or Databases. But how can we share CPU or RAM over the network.
To do this the program(s) accessing the CPU/RAM resources must be specifically designed to access said resources. A system set up in this manner is called a cluster, and the typical way resources are shared is with a protocol called MPI (message passing interface). It is a free download and using it with Linux can yield a powerful cluster (possibly even a super computer) for minimal cost, but again it is useless unless you have programs that were specifically designed to take advantage of MPI. There are some good cluster tutorials out there, if you are still interested you should check one out.
I would recommend the tutorial here if you want to set up a cluster. I made a cluster by following this tutorial about a year ago and it worked pretty well. The tutorial is a bit old, so some files may not be exactly where the tutorial says they are (sometimes files get moved around in different/newer Linux distros) but if you are the least bit familiar with Linux it should not be an issue. The tutorial uses an older version of MPI, but I used the newest version and had no issues that were not easily resolved. Depending on what you are doing there may actually be a program out there that can take advantage of MPI. I know there are some video encoding and number crunching programs that take advantage of MPI that can be downloaded from universal sources.
You can share RAM using RAM disks, but that looks just like sharing normal disks, except that these are in another computer's RAM. There is no direct way for one computer to use another computer's RAM as if it was its own RAM, but there are some ways to use other computer's RAM. More on that in next paragraph.
As for CPU sharing, it's possible but there is no single standard for it. You can't just share it and let another computer take needed resources. Instead you need to have specifically designed applications which can work on several computers at one. This is often called distributed computing and is used by some research projects such as SETI@Home, Einstein@Home, Climateprediction.net and many others.
Basically programs work in such way that there is one central server which distributes the work which needs to be done. Computers on network download work units from central computer and process them. After that central computer receives results from clients and merges them into one cohesive result. This way computers "share" CPU and RAM resources over network. The downside of this is that programs need to be made in such way as to work over network and right now distributed computing isn't popular enough among common uses for a computer so only a small number of specialized programs support it. On the other hand, it is commonly used for scientific purposes as it is cheaper to obtain large number of personal computers or playstations 3 than it is to obtain access to a mainframe computer.