Right Livelihood is the fifth of the eight path factors in the Noble Eightfold Path, and belongs to the virtue division of the path.

The definition

"And what is right livelihood? There is the case where a disciple of the noble ones, having abandoned dishonest livelihood, keeps his life going with right livelihood: This is called right livelihood." — SN 45.8

A balanced livelihood

"Herein, Vyagghapajja, a householder knowing his income and expenses leads a balanced life, neither extravagant nor miserly, knowing that thus his income will stand in excess of his expenses, but not his expenses in excess of his income. "Just as the goldsmith, or an apprentice of his, knows, on holding up a balance, that by so much it has dipped down, by so much it has tilted up; even so a householder, knowing his income and expenses leads a balanced life, neither extravagant nor miserly, knowing that thus his income will stand in excess of his expenses, but not his expenses in excess of his income." — AN 8.54

Its relation to the other factors of the path

"And how is right view the forerunner? One discerns wrong livelihood as wrong livelihood, and right livelihood as right livelihood. And what is wrong livelihood? Scheming, persuading, hinting, belittling, & pursuing gain with gain. This is wrong livelihood... "One tries to abandon wrong livelihood & to enter into right livelihood: This is one's right effort. One is mindful to abandon wrong livelihood & to enter & remain in right livelihood: This is one's right mindfulness. Thus these three qualities — right view, right effort, & right mindfulness — run & circle around right livelihood." — MN 117

Wrong livelihood for lay followers

"A lay follower should not engage in five types of business. Which five? Business in weapons, business in human beings, business in meat, business in intoxicants, and business in poison." — AN 5.177

Wrong livelihood for contemplatives

... reading marks on the limbs [e.g., palmistry]; reading omens and signs; interpreting celestial events [falling stars, comets]; interpreting dreams; reading marks on the body [e.g., phrenology]; reading marks on cloth gnawed by mice; offering fire oblations, oblations from a ladle, oblations of husks, rice powder, rice grains, ghee, and oil; offering oblations from the mouth; offering blood-sacrifices; making predictions based on the fingertips; geomancy; laying demons in a cemetery; placing spells on spirits; reciting house-protection charms; snake charming, poison-lore, scorpion-lore, rat-lore, bird-lore, crow-lore; fortune-telling based on visions; giving protective charms; interpreting the calls of birds and animals ... [The list goes on and on] — DN 2

Then Yodhajiva the headman went to the Blessed One and, on arrival, having bowed down to him, sat to one side. As he was sitting there he said to the Blessed One: "Lord, I have heard that it has been passed down by the ancient teaching lineage of warriors that 'When a warrior strives & exerts himself in battle, if others then strike him down & slay him while he is striving & exerting himself in battle, then with the breakup of the body, after death, he is reborn in the company of devas slain in battle.' What does the Blessed One have to say about that?" "Enough, headman, put that aside. Don't ask me that." A second time... A third time Yodhajiva the headman said: "Lord, I have heard that it has been passed down by the ancient teaching lineage of warriors that 'When a warrior strives & exerts himself in battle, if others then strike him down & slay him while he is striving & exerting himself in battle, then with the breakup of the body, after death, he is reborn in the company of devas slain in battle.' What does the Blessed One have to say about that?" "Apparently, headman, I haven't been able to get past you by saying, 'Enough, headman, put that aside. Don't ask me that.' So I will simply answer you. When a warrior strives & exerts himself in battle, his mind is already seized, debased, & misdirected by the thought: 'May these beings be struck down or slaughtered or annihilated or destroyed. May they not exist.' If others then strike him down & slay him while he is thus striving & exerting himself in battle, then with the breakup of the body, after death, he is reborn in the hell called the realm of those slain in battle. But if he holds such a view as this: 'When a warrior strives & exerts himself in battle, if others then strike him down & slay him while he is striving & exerting himself in battle, then with the breakup of the body, after death, he is reborn in the company of devas slain in battle,' that is his wrong view. Now, there are two destinations for a person with wrong view, I tell you: either hell or the animal womb." When this was said, Yodhajiva the headman sobbed & burst into tears. [The Blessed One said:] "That is what I couldn't get past you by saying, 'Enough, headman, put that aside. Don't ask me that.'" "I'm not crying, lord, because of what the Blessed One said to me, but simply because I have been deceived, cheated, & fooled for a long time by that ancient teaching lineage of warriors who said: 'When a warrior strives & exerts himself in battle, if others then strike him down & slay him while he is striving & exerting himself in battle, then with the breakup of the body, after death, he is reborn in the company of devas slain in battle.' — SN 42.3