Most racks don't include any form of locking device as standard, so you'll need to buy this as an accessory. You may get some security to stop the rack itself from being removed from your vehicle - of itself most racks are fairly expensive before you add the bikes on top.
There is then usually a system available to buy that's custom-made to lock your bikes to the rack. Look out for its security rating; most will deter opportunist theft but not the professional. It's still sensible to remove your bike and lock it somewhere secure if you're leaving your bike for a longer period or overnight.
A lightweight option like the Hiplok Z Lok may be worth considering to make removing your bike a little harder, although again it won't be as secure as the best bike locks.