what are the security risks of using this method?
Security risks are present when something is, well, insecure. An approach is not usually where security issues lie, but more in the code itself.
As long as your code is tight and there is no way for them to circumvent the code or trick their way around your login, then I see no issues with it.
So as long as your code identifies with 100% certainty what their logged in status is, then your code can simply perform an if/else: Check if they are logged in, IF yes show content, ELSE show either a login form on that page, or a link to a login page.
This way they never get access to sensitive data. The IF/ELSE is just as secure on the page that holds the sensitive data as it is on another page where you have the redirect, as either way, them getting the code or not is solely dependant on how secure your confirming their logged in status is.
Redirect seems a bit harsh if it's only a few pages. Automatic redirection to a login page is usually to keep someone out of a large section, rather than a single or few pages.
Just keep the code for the page where login is required clean, that is don't have login forms and form checking code all in the same page which is for something else (ie content).
If you don't decide to redirect them to a page (script) whose purpose is to action and control login, then at the least include a separate file that does all of this if deemed they're not logged in, but better to do a class, or at least function.
Whichever of the methods above you choose, make sure the login form and code is in a separate and designated area where the code can be reused.