Since the topic of travelling from Poland to Ukraine by land comes up regularly in the topics about Lviv/Ukraine, it might be handy to have a topic specifically dedicated to this journey.
From Poland to Ukraine
I've travelled from Poland to Lviv numerous times and can say without a doubt that the fastest and cheapest way to make this journey, is to:
1. Take a train to Przemyśl.
2. Take a bus to Medyka.
3. Walk past the Medyka-Shehyni border crossing.
4. Take a bus or train from Shehyni to Lviv.
5. Take a train to Kiev.
1. Train to Przemyśl
You can easily find schedules and buy tickets at the (English) website of the Polish train company PKP.
2. Przemyśl - Medyka (bus)
Costs: 2 złoty (~ € 0,50). You simply hand the money to the driver when getting into the bus. There are no extra costs for luggage. Some of the buses are quite small though, so it could happen that there's no room for your luggage, although this has never happened to me (generally I was the only non-local taking this bus). In this case you could wait for a new bus or take a taxi; there are generally some taxi's waiting at the same place as the bus station.
Duration: ~ 20 minutes.
Place of departure: at the 'back' of the main station of Przemyśl. You can get there by first walking through the (small) main hall of the station and then walking through the underground. Walk all the way to the end and take the stairs up again. There you will see several buses, which all have a sign at the front which indicates the destination. Pick the one which says 'Medyka'. It could be that this bus isn't there yet; then you'll have to wait, but generally for no longer than 30 minutes.
Place of arrival: right at the border. It's the final stop of the bus and the destination for almost all of the people taking this bus, so you can't miss it.
Frequency of departure: my guess would be every 30 minutes, but I'm not sure. There seems to be no official schedule. The last bus seems to depart somewhere around 18:00 (6 PM). The first one around 6:00 (6 AM). Take into account that this might be different for Polish holidays.
3. Medyka - Shehyni (walk)
Costs: free.
Duration: for people with a passport from an EU-country, EEA-country or Switzerland: 10-15 minutes. It might be more for others.
Process: once in Medyka, you will see a pizzeria and Kantor (exchange office -- with terrible exchange rates). Just walk past them until there is a 'split' in the road. One line is for people with a passport from the EU, an EEA-country (Iceland, Norway and Liechtenstein) or Switzerland. People with other passports have to take the other line. I only have experience with the EU-line. Generally, there is hardly any line, so the whole process (including two passport checks, one or zero luggage checks and generally a short 'interview' with an Ukrainian border guard that can only speak ~10 words in English) will take only 10-15 minutes. The border is actually open 24/7. However, it makes little sense to cross the border at night by foot, since there's no public transport at night.
From Poland to Ukraine
I've travelled from Poland to Lviv numerous times and can say without a doubt that the fastest and cheapest way to make this journey, is to:
1. Take a train to Przemyśl.
2. Take a bus to Medyka.
3. Walk past the Medyka-Shehyni border crossing.
4. Take a bus or train from Shehyni to Lviv.
5. Take a train to Kiev.
1. Train to Przemyśl
You can easily find schedules and buy tickets at the (English) website of the Polish train company PKP.
2. Przemyśl - Medyka (bus)
Costs: 2 złoty (~ € 0,50). You simply hand the money to the driver when getting into the bus. There are no extra costs for luggage. Some of the buses are quite small though, so it could happen that there's no room for your luggage, although this has never happened to me (generally I was the only non-local taking this bus). In this case you could wait for a new bus or take a taxi; there are generally some taxi's waiting at the same place as the bus station.
Duration: ~ 20 minutes.
Place of departure: at the 'back' of the main station of Przemyśl. You can get there by first walking through the (small) main hall of the station and then walking through the underground. Walk all the way to the end and take the stairs up again. There you will see several buses, which all have a sign at the front which indicates the destination. Pick the one which says 'Medyka'. It could be that this bus isn't there yet; then you'll have to wait, but generally for no longer than 30 minutes.
Place of arrival: right at the border. It's the final stop of the bus and the destination for almost all of the people taking this bus, so you can't miss it.
Frequency of departure: my guess would be every 30 minutes, but I'm not sure. There seems to be no official schedule. The last bus seems to depart somewhere around 18:00 (6 PM). The first one around 6:00 (6 AM). Take into account that this might be different for Polish holidays.
3. Medyka - Shehyni (walk)
Costs: free.
Duration: for people with a passport from an EU-country, EEA-country or Switzerland: 10-15 minutes. It might be more for others.
Process: once in Medyka, you will see a pizzeria and Kantor (exchange office -- with terrible exchange rates). Just walk past them until there is a 'split' in the road. One line is for people with a passport from the EU, an EEA-country (Iceland, Norway and Liechtenstein) or Switzerland. People with other passports have to take the other line. I only have experience with the EU-line. Generally, there is hardly any line, so the whole process (including two passport checks, one or zero luggage checks and generally a short 'interview' with an Ukrainian border guard that can only speak ~10 words in English) will take only 10-15 minutes. The border is actually open 24/7. However, it makes little sense to cross the border at night by foot, since there's no public transport at night.