You may also claim their throne by force - if their king is without an heir and your prestige is higher than theirs, you will get a diplo-option to claim the throne. If that happens, and the marriage has been stable for 50 years, you have a chance to inherit the whole country. If you enter a royal marriage with another country, given time you'll share the same dynasty (you can see that by hovering over your king).
The second way, the one you mentioned, is to claim their throne. This obviously works best if they have the same religion as you. Then, all you need is for them to like you a lot (190 opinion), so designate a rival of theirs as yours, send your diplomat to improve relations and hope for the best. If you are able or not depends greatly on your own size (number of provinces) and on theirs, as well as on the difference between your tax-base. There is two ways - For very small countries bordering you, vassalising them is the way to go.