This post is going to assume that you already know how to create a custom master page for SharePoint. There are dozens of articles and posts explaining how to do this. This post is a quick tip about when you have already applied your master page to your site and it works but doesn't get applied to your custom pages. By custom pages I mean pages that you add via a site definition or feature. Open up the aspx page with VS or SPD and at the top of your aspx page you will need to change your masterpagefile property
From
<%@ Page MasterPageFile="~masterurl/default.master" Debug="true" …
To
<%@ Page MasterPageFile="~masterurl/custom.master" Debug="true" …
That is it. Now whatever master page you have applied to the site will be applied to this page as well.