Many devices have some memory used to communicate with another devices or CPU.
RAM memory is not only memory in your computer. It is just "general purpose memory".
Hard disk controller has some memory used as buffer. If you are saving file - your CPU puts data into memory of hard disk controller, puts data into control registers and disk controller starts working on it. CPU just puts data into that disk controller memory and is not busy anymore.
Similar with graphics cards, sound cards, network cards. They must have some memory in order to work.
Lets say, we are building very simple "graphics card" for PCI that supports 1 pixel "screen" and that pixel is just a LED with 8-bit brightness control (0-255). We connect that diode to some microcontroller, and add 1 byte memory outside. We connect that memory to PCI and microcontroller.
Our microcontroller reads memory every frame and controls our LED according to data read from memory. On computer side - we just use PCI memory write command and we write 0-255 numbers into that memory.
This is how simple PCI devices work. All information above is very simplified for better understanding.
More advanced answer (if you already know something about PC hardware)
In PCI there are few adress spaces.
Memory addresses are 32 bit wide (there is also 64-bit PCI-X / not PCI Express!), support caching and can be burst transactions.
There are also I/O addresses and they are compatybile Intel x86 architecture's I/O port address space.