You need to get from Pai first to Chiang Khong which is the town on the Thai side of the border -- you'll most likely need to go via Chiang Mai, though there could be private tourist minibus services between the pai and Chiang Khong.
Once there, cross the river to Huay Xai and the slow boats depart every morning.
I did this travel trip last month from chiang mai, from chiang khong/huay xai the slow boat goes to pak beng, on the next day you will arive. so it's a 2 day turn from huay xai. but the beautiful landscapes around the mekong are realy nice!!!
i hope this post helps you.
a report of my travel trip from chiang mai to luang prabang