Typically, the third (tach) wire is grounded "n" times per revolution, where "n" varies between fan models, but typically 2 or 4 times per revolution. (The data sheet fro the fan should specify this.)
You will need to add a pull-up resistor to give you a square wave signal which you can feed into a digital input. You will need to measure the period of the square wave or count transitions per second to compute the RPM.
For example, assume 6000RPM and 4 pulses per revolution, you will see 400 pulses per second and the average period of a pulse (leading-edge to leading-edge) would be 2.5ms (1/400).
As for actually reading the pin, the easiest way would be to set up an interrupt on a transition (either up or down) and record the value of a high resolution timer in a buffer, which you can read in your main line to compute average period over several cycles. Alternatively, you can loop pooling the pin looking for changes and record the timer values.
Edit: Jim Deardan correctly notes that on most fans, the tach wire is already pulled up to +12V and the voltage needs to be reduced before connecting to an input on the PIC. Please read his comment.