Er... how about asking them what they WANT? We'll take it for granted that you're not asking for the magic words that will make your dev work harder or longer for you, just because they're now "motivated".
You have to offer devs a carrot, because the stick won't work - devs can find work elsewhere. And the defacto carrot, money, isn't very effective - devs already make good wages, and whatever you offer them, they'll probably be able to get on the open market anyway. So how in the world do you motivate someone you can't threaten or throw money at??? A conundrum!
Well, what motivates me, an average 30-year-old dev who's been in the field for 10+ years? Two words: respect and enjoyment.
I want to be respected for the expertise and experience I have. I do have a clue about how difficult some things are, how long they take, how much work they involve, and I'm not blowing smoke up your ass when I say that doing X is probably going to push Project Y beyond deadline Z. It's not laziness, it's experience in the word of software development.
I want to be respected for how much I contribute, especially beyond the call of duty - mentoring others, helping where not asked, working extra hours. A note or word helps, but a steady ladder of promotion is important; it's the career version of the "leveling up" syndrome that keeps people playing asinine iOS games for hours on end. Bump me from a Developer 4 to Developer 5, every couple years, and bump my salary a little bit to make it more than symbolic; I'll know you understand my value to you increases over time.
I also want you to respect that I have a life I treasure very much, outside of work. My priority is my kids, and when they're sick, or have a special event, and they need me, it is important to me to be there. My time is precious, and limited with them - 6pm to 9pm is what I get with them on weekdays, and while I will work extra when the situation demands, I expect you to limit the amount of time you ask me to infringe on that. Your terrible project management or unreasonable deadlines are NOT going to 'motivate' me to work 50/60 hour weeks, and if you push me too much, I will go somewhere where they DO respect this.
Enjoyment means that you give me interesting, challenging problems to solve. This DOESN'T mean I want to use only cool technologies, or try to map the Human Genome. It means giving me tasks that have a little freedom to it - find me a way to authenticate people in system X and transfer them to system Y. Some analysis, some research into alternative methods, some coding to implement the solution - those are interesting, challenging problems. Common, but what I became a developer to do.
Enjoyment also means giving me people who are enjoyable to work with. Or rather, people who aren't asses to deal with. Nothing KILLS motivation more than dealing with people who are simply terrible co-workers. You don't need Happy Hour friends; just people who have some technical and people skill, and support each other.
Lastly, enjoyment means giving me a company with a positive outlook, that cares about it's employees, and doesn't seem to be driving itself backward or off a cliff. Why would I want to write software for a company who seems on the edge of bankruptcy? I want to help that company "do things", make people's lives better, whether it's making payrolls easier to handle or solving world hunger. Seeing it succeed means I'm having a positive impact, small or large, and motivates me to keep working to make that impact felt even further.
Your dev might have different wants, but if you make the effort to respect them, and let them enjoy working for you, it will go far further to motivate them to work harder for you than just bumping up salaries or giving inspiring speeches or treating them like they're a cog that can be readily replaced.