The term "SPI" is applied to a variety of protocols. A typical SPI system will have one "master" device and one or more slaves. Each slave device will have a clock input, a data input, a data output, and typically a chip-select wire. A master device will have a clock output, data out, and data in, and will typically use a general-purpose I/O to drive slaves' chip-select wires. Generally, a slave-device's communications state machine will be held in reset any time its chip-select wire is deasserted.
There are so many variations that merely knowing something is "SPI" doesn't really say much about it. It's helpful to know that "MOSI" (master-out-slave-in) is a term used to describe both the master's data output and the slave's data input, and "MISO" (master-in-slave-out) is a term used to describe both the slave's data output and the master's data input. Otherwise, though, one really must consult an SPI device's data sheet to know how one will need to communicate with it. Most SPI peripherals found in microcontrollers can support the more common variations, but not all conrollers support all variations. For example, while most devices send and receive data most-significant-bit first, some devices send and receive data least-significant-bit first (and may have hardware reasons for doing so).