Difference between RAM and buffer
A buffer is usually used only as temporary storage while something is being transmitted or read. For instance, you might be reading data from a slow-response external storage medium (e.g., a CD) and processing it continuously. In this setting, the first process reads chunks of data from the medium and writes it to the buffer on demand, while the latter reads from the buffer as if it were reading from storage directly. This avoids deadlocks in that the latter process does not need exclusive access to the medium.

In contrast, RAM is simply what is used as main memory for the processes in a general-purpose computer. There might be several buffers not only in RAM but also in other memory units. Saying that RAM is used for "temporary storage" can be rather misleading since "temporary" here actually means "until the process using it is inactive or extinct" (and not "until the data is not needed anymore").

In summary, a buffer is an abstracted concept (and only really exists at the software level); RAM is a concrete type of storage technology.