There are two main techniques: (1) one technique is used for Unix
servers and utilizes a special file named htaccess that keeps track of
all passwords needed to open any file in a given directory,
(2) the other technique is for Windows IIs servers and FrontPage, which
uses its own server extentions to grant rights to files in a given
directory.
Check with your ISP to see what type of server your site is run on
(assuming you aren't doing it yourself) and they can tell you the best
way to add security to your site.
I have been using technique #1 for a few years but recently switched to
technique #2.
There is a 3rd technique that is not very secure and can be easily
hacked, and that is using javascript to password encode a given page...a
"down and dirty" method that you wouldn't want to use on anything
regarding privacy issues...
For more about technique #3, check out
http://javascript.internet.com/passwords/