Yes.
use a file that checks user login. If login is invalid, show an error message. If it is valid, set headers matching the file (like the filename, mimetype, etc), and load up the file through file_get_contents() and echo the contents.
The file itself should be placed in a dir that is not reachable through web. So this could be one level higher than your public_html or httpdocs dir. You can also put a htaccess file in a publicly available dir and set it to deny requests from everyone. That way you can only get the file through the PHP file, and that checks for the login.
some references:
php.net/header
php.net/file_get_contents
for the htaccess file google on something like 'allow deny access htaccess', that should get you some tutorials.