All you have to do is:
Use the java script given below:
Replace the "Facebook_id" with your friend's id. Your friends id is the number displayed on the page URL on his/her Profile Page, which looks like this http://www.facebook.com/profile.php?id=592456486&ref=nf
Copy that numbers exactly and replace only the "Facebook_id" on the code, don't replace the brackets and ";" must be there.
Now copy all the script with your friends id and paste it on the browser's address bar then hit enter, the chat window should pop-up with the history on it.
Note: Chat history is cleared every few days, so you can't rely on this code always. But this code works perfectly for recent history.
If you need some more help here is a video tutorial that can guide you through: