When you do something rakishly, you're doing it in a careless, charming way while also conveying a sense of being a bit disreputable. A mischievous magician might grin rakishly as he suavely transforms your ten-dollar bill into a quarter.
People who behave rakishly have an undeniable charm. You can even use this adverb to describe the way someone dresses, or their sense of style: "Her hat was tipped rakishly to the side, giving her a jaunty appeal." Underlying this charisma is a sense of depravity, as in the case of a pickpocket who flirts rakishly with his victims as he's stealing their wallets. Rakishly comes from rake, "idle, dissolute person."