|| These are all ways of distributing software. Since software is just information, it can be downloaded, transferred over the Internet, as easily as an image on a Web page. Well maybe a little harder, since software is usually larger. So many software producers distribute their programs this way, with various restrictions.
Open Source software is completely free to everyone, including the source code. This means that people can not only use the program for free, but they can see how it was made, make changes, fix bugs, take out parts to use in other programs, and so forth. There are sometimes minor restrictions, such as having to attribute the source when the program is modified. The Open Directory Project itself is not quite Open Source, since it doesn’t release the software behind how it works, but is Open Content, which is quite similar.
Freeware is free software, but not necessarily with source code. If you’re not a programmer, the difference between Open Source and Freeware, to you, is only that with Open Source if the program breaks, or you want an improvement, you can take it to your friend who is a programmer, and she can try to fix it for you, even if the original author has stopped maintaining the program for whatever reason. If you don’t have the source code, you generally can’t do that.
Shareware is a program that is available for free, and may be redistributed for free, but with restrictions, typically it’s only free for a limited time, then you need to pay a fee to use it further. The source code is usually not available, for free or otherwise. Many people never pay that fee – but shareware is not meant to be free software.
There are many subcategories of each of these, for example crippleware is a program distributed as shareware with various important parts turned off, trialware is shareware that enforces its limited use period itself, by refusing to run after a certain time, postcardware is freeware or shareware where the seller demands a rather cheap price, a postcard from the user, so the author can know their work is appreciated, and others.
Finally, some programs are custom written for a specific user, and are not meant to be redistributed at all.