Taking the fast train from Samarkand to Bukhara is a very comfortable way to travel compared to shared taxis and marshrutkas. There is a morning train that leaves around 09:40, costs 57600 somoni, and only takes 1.5 hours. Passport must be shown to buy tickets.
The train station (Vokzal) in Samarkand is located at Map Location: 39.685411, 66.928874 . Bus 3 and 73 run from Registan Street (the main street next to the Registan) to the train station. Taxis will charge around 10000 somoni for the trip and are much faster than the buses. The ticket office has a separate entrance on the east (right) side of the main building.
The train station in Bukhara is about 13 kms outside of the city, Map Location: 39.722241, 64.548588 . Taxis charge between 30k and 50k depending on day or night and the negotiating skill of the passenger.