Genesis Chapter 38 -40
Special thanks are given to Jesus Christ, my Lord and Savior, for the gift of writing and the privilege of sharing this Bible Study. His guidance and blessings have made this work possible, and it is with a grateful heart that can share my study with you. I hope you find it informational and helpful in your spiritual journey. I am asking that you open your hearts and minds to accept the word of Christ into your hearts and accept His word to transform your life in positive ways. This is the first part of my online Christian Bookstore Fellowship and I do accept donations that will further my mission to have a Bookstore in our community, a place where we can sit down face to face and enjoy this Bible Study over open and honest conversation. I will continue this online Study as well to complete the entire year. Thank you for following The Mustard Seed Christian Bookstore Fellowship & Café online Bible Study.
This Bible study is written with inspiration and wisdom from the Holy Spirit, Scripture from the Holy Bible (NIV), NKJV Life Application Study Bible, analytical support and help in organizing and presentation from Grok AI and writing assistance with drafting and editing from Microsoft Co-Pilot.
Dear Almighty Father in Heaven
As we begin our study of Genesis 38 -40 lets us open our hearts and our minds for wisdom and understanding of the lesson you have for us to learn. Give us faith like Joseph and let us avoid temptations that he endured and strength to run as he did when faced with sexual temptations. Lord let us keep our eyes focused on you and let our hearts keep your words on our tongues. Deflect all evil thing that may tempt us. Let us not hold anger or contempt against our brothers or sisters even when they do us wrong. We pray this in the name of Jesus Christ our Lord and Savior. Amen
Genesis 38-40
Judah and Tamar
1It came to pass at that time that Judah departed from his brothers, and visited a certain Adullamite whose name was Hirah. 2And Judah saw there a daughter of a certain Canaanite whose name was Shua, and he married her and went in to her. 3So she conceived and bore a son, and he called his name Er. 4She conceived again and bore a son, and she called his name Onan. 5And she conceived yet again and bore a son, and called his name Shelah. He was at Chezib when she bore him.
6Then Judah took a wife for Er his firstborn, and her name was Tamar. 7But Er, Judah’s firstborn, was wicked in the sight of the Lord, and the Lord killed him. 8And Judah said to Onan, “Go in to your brother’s wife and marry her, and raise up an heir to your brother.” 9But Onan knew that the heir would not be his; and it came to pass, when he went in to his brother’s wife, that he emitted on the ground, lest he should give an heir to his brother. 10And the thing which he did displeased the Lord; therefore He killed him also.
11Then Judah said to Tamar his daughter-in-law, “Remain a widow in your father’s house till my son Shelah is grown.” For he said, “Lest he also die like his brothers.” And Tamar went and dwelt in her father’s house.
12Now in the process of time the daughter of Shua, Judah’s wife, died; and Judah was comforted, and went up to his sheepshearers at Timnah, he and his friend Hirah the Adullamite. 13And it was told Tamar, saying, “Look, your father-in-law is going up to Timnah to shear his sheep.” 14So she took off her widow’s garments, covered herself with a veil and wrapped herself, and sat in an open place which was on the way to Timnah; for she saw that Shelah was grown, and she was not given to him as a wife. 15When Judah saw her, he thought she was a harlot, because she had covered her face. 16Then he turned to her by the way, and said, “Please let me come in to you”; for he did not know that she was his daughter-in-law.
So she said, “What will you give me, that you may come in to me?”
17And he said, “I will send a young goat from the flock.”
So she said, “Will you give me a pledge till you send it?”
18Then he said, “What pledge shall I give you?”
So she said, “Your signet and cord, and your staff that is in your hand.” Then he gave them to her, and went in to her, and she conceived by him. 19So she arose and went away, and laid aside her veil and put on the garments of her widowhood.
20And Judah sent the young goat by the hand of his friend the Adullamite, to receive his pledge from the woman’s hand, but he did not find her. 21Then he asked the men of that place, saying, “Where is the harlot who was openly by the roadside?”
And they said, “There was no harlot in this place.”
22So he returned to Judah and said, “I cannot find her. Also, the men of the place said there was no harlot in this place.”
23Then Judah said, “Let her take them for herself, lest we be shamed; for I sent this young goat and you have not found her.”
24And it came to pass, about three months after, that Judah was told, saying, “Tamar your daughter-in-law has played the harlot; furthermore she is with child by harlotry.”
So Judah said, “Bring her out and let her be burned!”
25When she was brought out, she sent to her father-in-law, saying, “By the man to whom these belong, I am with child.” And she said, “Please determine whose these are—the signet and cord, and staff.”
26So Judah acknowledged them and said, “She has been more righteous than I, because I did not give her to Shelah my son.” And he never knew her again.
27Now it came to pass, at the time for giving birth, that behold, twins were in her womb. 28And so it was, when she was giving birth, that the one put out his hand; and the midwife took a scarlet thread and bound it on his hand, saying, “This one came out first.” 29Then it happened, as he drew back his hand, that his brother came out unexpectedly; and she said, “How did you break through? This breach be upon you!” Therefore his name was called Perez. 30Afterward his brother came out who had the scarlet thread on his hand. And his name was called Zerah.
Genesis 39
Joseph a Slave in Egypt
1Now Joseph had been taken down to Egypt. And Potiphar, an officer of Pharaoh, captain of the guard, an Egyptian, bought him from the Ishmaelites who had taken him down there. 2The Lord was with Joseph, and he was a successful man; and he was in the house of his master the Egyptian. 3And his master saw that the Lord was with him and that the Lord made all he did to prosper in his hand. 4So Joseph found favor in his sight, and served him. Then he made him overseer of his house, and all that he had he put under his authority. 5So it was, from the time that he had made him overseer of his house and all that he had, that the Lord blessed the Egyptian’s house for Joseph’s sake; and the blessing of the Lord was on all that he had in the house and in the field. 6Thus he left all that he had in Joseph’s hand, and he did not know what he had except for the bread which he ate.
Now Joseph was handsome in form and appearance.
7And it came to pass after these things that his master’s wife cast longing eyes on Joseph, and she said, “Lie with me.”
8But he refused and said to his master’s wife, “Look, my master does not know what is with me in the house, and he has committed all that he has to my hand. 9There is no one greater in this house than I, nor has he kept back anything from me but you, because you are his wife. How then can I do this great wickedness, and sin against God?”
10So it was, as she spoke to Joseph day by day, that he did not heed her, to lie with her or to be with her.
11But it happened about this time, when Joseph went into the house to do his work, and none of the men of the house was inside, 12that she caught him by his garment, saying, “Lie with me.” But he left his garment in her hand, and fled and ran outside. 13And so it was, when she saw that he had left his garment in her hand and fled outside, 14that she called to the men of her house and spoke to them, saying, “See, he has brought in to us a Hebrew to mock us. He came in to me to lie with me, and I cried out with a loud voice. 15And it happened, when he heard that I lifted my voice and cried out, that he left his garment with me, and fled and went outside.”
16So she kept his garment with her until his master came home. 17Then she spoke to him with words like these, saying, “The Hebrew servant whom you brought to us came in to me to mock me; 18so it happened, as I lifted my voice and cried out, that he left his garment with me and fled outside.”
19So it was, when his master heard the words which his wife spoke to him, saying, “Your servant did to me after this manner,” that his anger was aroused. 20Then Joseph’s master took him and put him into the prison, a place where the king’s prisoners were confined. And he was there in the prison. 21But the Lord was with Joseph and showed him mercy, and He gave him favor in the sight of the keeper of the prison. 22And the keeper of the prison committed to Joseph’s hand all the prisoners who were in the prison; whatever they did there, it was his doing. 23The keeper of the prison did not look into anything that was under Joseph’s authority, because the Lord was with him; and whatever he did, the Lord made it prosper.
Genesis 40
The Prisoners’ Dreams
1It came to pass after these things that the butler and the baker of the king of Egypt offended their lord, the king of Egypt. 2And Pharaoh was angry with his two officers, the chief butler and the chief baker. 3So he put them in custody in the house of the captain of the guard, in the prison, the place where Joseph was confined. 4And the captain of the guard charged Joseph with them, and he served them; so they were in custody for a while.
5Then the butler and the baker of the king of Egypt, who were confined in the prison, had a dream, both of them, each man’s dream in one night and each man’s dream with its own interpretation. 6And Joseph came in to them in the morning and looked at them, and saw that they were sad. 7So he asked Pharaoh’s officers who were with him in the custody of his lord’s house, saying, “Why do you look so sad today?”
8And they said to him, “We each have had a dream, and there is no interpreter of it.”
So Joseph said to them, “Do not interpretations belong to God? Tell them to me, please.”
9Then the chief butler told his dream to Joseph, and said to him, “Behold, in my dream a vine was before me, 10and in the vine were three branches; it was as though it budded, its blossoms shot forth, and its clusters brought forth ripe grapes. 11Then Pharaoh’s cup was in my hand; and I took the grapes and pressed them into Pharaoh’s cup, and placed the cup in Pharaoh’s hand.”
12And Joseph said to him, “This is the interpretation of it: The three branches are three days. 13Now within three days Pharaoh will lift up your head and restore you to your place, and you will put Pharaoh’s cup in his hand according to the former manner, when you were his butler. 14But remember me when it is well with you, and please show kindness to me; make mention of me to Pharaoh, and get me out of this house. 15For indeed I was stolen away from the land of the Hebrews; and also I have done nothing here that they should put me into the dungeon.”
16When the chief baker saw that the interpretation was good, he said to Joseph, “I also was in my dream, and there were three white baskets on my head. 17In the uppermost basket were all kinds of baked goods for Pharaoh, and the birds ate them out of the basket on my head.”
18So Joseph answered and said, “This is the interpretation of it: The three baskets are three days. 19Within three days Pharaoh will lift off your head from you and hang you on a tree; and the birds will eat your flesh from you.”
20Now it came to pass on the third day, which was Pharaoh’s birthday, that he made a feast for all his servants; and he lifted up the head of the chief butler and of the chief baker among his servants. 21Then he restored the chief butler to his butlership again, and he placed the cup in Pharaoh’s hand. 22But he hanged the chief baker, as Joseph had interpreted to them. 23Yet the chief butler did not remember Joseph, but forgot him.
Wrapping it up
Genesis chapters 38–40 form part of the larger Joseph narrative in the book of Genesis, but they highlight several profound spiritual lessons about God's character and His ways of working in human lives. These chapters contrast the failures and redemption in Judah's story with Joseph's faithfulness amid suffering, ultimately pointing to God's sovereign providence, faithfulness to His promises, and grace even through human sin and hardship.
Key Events Recap
Genesis 38: Focuses on Judah (one of Joseph's brothers) and his daughter-in-law Tamar. Judah's sons die, leaving Tamar childless and without family rights under levirate custom. Judah fails to fulfill his responsibilities, so Tamar disguises herself as a prostitute to conceive children by Judah himself. When her pregnancy is discovered, Judah initially condemns her—until confronted with evidence of his own involvement, he admits, "She is more righteous than I" (Gen 38:26). Tamar bears twins, Perez and Zerah, and Perez becomes an ancestor in the line leading to King David and ultimately Jesus.
Genesis 39: Joseph, sold into slavery in Egypt, serves faithfully in Potiphar's household. "The Lord was with Joseph" (repeated emphasis in vv. 2, 3, 21, 23), causing him to prosper. When Potiphar's wife tries to seduce him, Joseph refuses, citing loyalty to God and his master. Falsely accused, he is imprisoned—yet again, "the Lord was with him" and grants him favor with the prison warden.
Genesis 40: In prison, Joseph interprets the dreams of Pharaoh's cupbearer and baker through God's wisdom ("Do not interpretations belong to God?" – v. 8). The interpretations come true, but the cupbearer forgets Joseph.
What God May Be Teaching Through These Chapters
These chapters, though contrasting in tone (Judah's moral mess vs. Joseph's integrity), weave together key themes that reveal God's deeper work:
God's sovereign providence and unstoppable plan God advances His covenant promises (from Abraham: descendants, blessing to the nations) despite human failure. In Genesis 38, even through deception, incestuous relations, and Judah's hypocrisy, God preserves the Messianic line via Perez. The "ugly" story shows that no human sin or dysfunction can derail God's redemptive plan—He weaves even broken people and sinful actions into His purposes. This contrasts with Joseph's story, where providence shines through blessing in hardship.
God's presence and blessing in all circumstances The repeated phrase "the Lord was with Joseph" (Gen 39:2, 3, 21, 23) is a powerful refrain. Whether in prosperity (Potiphar's house) or unjust suffering (prison), God's presence brings success and favor. This teaches that faithfulness to God matters more than circumstances—God can prosper you and use you anywhere, even in prison or exile.
The importance of integrity, faithfulness, and resisting temptation Joseph models fleeing sin ("How then could I do such a wicked thing and sin against God?" – Gen 39:9). He chooses obedience over convenience, even when it costs him freedom. This contrasts sharply with Judah's moral compromise in chapter 38, showing the consequences of unrighteousness versus the quiet blessing of walking uprightly.
Repentance, justice, and grace in human failure Judah's confession ("She is more righteous than I") marks a turning point—acknowledging sin opens the door to grace. Tamar, though using deception, seeks justice in a system that failed her. God honors her role in preserving the family line, reminding us that grace reaches the marginalized and that true righteousness involves owning our wrongs.
Trusting God's timing and using gifts for His glory In prison, Joseph interprets dreams accurately but gives credit to God. He serves faithfully in small things (managing the prison), which prepares him for greater responsibility later. This teaches patience—God often uses waiting periods and "forgotten" seasons to build character and position us for future purposes (as seen in Joseph's eventual rise in Genesis 41+).
Overall, these chapters teach that God is faithful to His promises and people, even when life feels chaotic, unjust, or morally messy. Human sin doesn't surprise or stop Him; instead, He redeems and redirects. For Joseph personally, it's a lesson in steadfast trust amid betrayal and false accusation. For Judah's line, it's a reminder that God's grace pursues flawed families to bring about salvation.
Lessons being taught
1. God's Sovereign Providence Overrules Human Sin and Failure
Genesis 38 is deliberately placed to highlight this: Judah's family descends into moral chaos (deception, immorality, neglect of responsibility), yet God still advances His covenant promise. Through Tamar's bold (and ethically complex) actions and Judah's eventual confession ("She is more righteous than I," Gen 38:26), the line of Perez is preserved—Perez becomes an ancestor of David and ultimately Jesus (Ruth 4:18–22; Matt 1:3). Lesson: No amount of human brokenness, hypocrisy, or sin can thwart God's redemptive plan. He redeems even the ugliest situations and uses flawed people in His purposes.
2. God's Presence Brings Blessing and Success in Any Circumstance
The phrase "the Lord was with Joseph" is repeated emphatically in chapter 39 (vv. 2, 3, 21, 23) and chapter 40 (implied through his favor and gift). Whether prospering in Potiphar's house, facing false accusation and prison, or serving in obscurity, God's presence causes Joseph to succeed and gain favor. Lesson: True success and blessing come from God's presence, not from favorable circumstances. He can make you fruitful even in hardship, exile, or injustice.
3. Integrity and Faithfulness Matter—Even When It Costs You
Joseph refuses Potiphar's wife's advances, saying, "How then could I do this great wickedness and sin against God?" (Gen 39:9). He flees temptation and chooses obedience over temporary gain, even though it leads to prison. In contrast, Judah in chapter 38 compromises repeatedly (with Canaanites, failing Tamar, hypocrisy). Lesson: God honors those who walk in integrity and fear Him more than people or consequences. Short-term loss for righteousness often leads to long-term blessing.
4. Repentance and Confession Open the Door to Grace
Judah's turning point comes when confronted with his own sin—he admits Tamar's greater righteousness and stops condemning her. This marks growth (seen later in his character change in Genesis 44). Tamar, though using deception, seeks justice in a broken system where she was wronged. Lesson: Honest acknowledgment of sin leads to restoration and mercy. God values a repentant heart over outward perfection, and He cares about justice for the vulnerable.
5. Use Your God-Given Gifts Faithfully, Even in Small or Forgotten Places
In prison (chs. 39–40), Joseph manages the facility with excellence and interprets dreams accurately, always crediting God ("Do not interpretations belong to God?" – Gen 40:8). He serves selflessly, yet the cupbearer forgets him for two more years. Lesson: Faithfulness in small, unseen, or unfair seasons prepares you for greater responsibility. God sees and values humble service; promotion comes in His timing, not ours. Don't despise "prison" seasons—they build character and position.
Overall Message from Chapters 38–40
These chapters contrast Judah's moral failure with Joseph's steadfast trust, yet both show that God remains faithful to His promises despite human messiness. He is with His people in prosperity and prison, redeems sin-scarred stories, and uses ordinary (or even scandalous) events to fulfill His bigger plan of blessing the world through Abraham's descendants.
These passages encourage believers to trust God's unseen hand, choose integrity over expediency, repent quickly when wrong, and serve faithfully wherever you are—because He is working all things for good in ways often only seen later. Which of these lessons resonates most with you right now, or is there a specific part of these chapters you're reflecting on?
Applying the lessons from Genesis 38–40 to your life today involves intentional, practical steps rooted in reflection, prayer, and daily choices. These chapters show God's faithfulness amid human messiness (Judah/Tamar) and Joseph's steadfast integrity in hardship. Here's how to live them out right now—in your relationships, work, challenges, or "waiting" seasons—wherever you are in Billings or beyond.
1. Trust God's Sovereign Providence in Your Messy or Broken Situations
Lesson reminder: God advanced His redemptive plan through Judah's failures, Tamar's desperate actions, and family dysfunction—nothing derails Him.
Apply today:
When life feels chaotic (family conflicts, past regrets, unfair setbacks), pause and pray: "Lord, I don't see how this fits Your plan, but I trust You're weaving even this for good" (echoing Romans 8:28).
Journal one "messy" area right now (e.g., a strained relationship or unresolved hurt). Ask God to show you how He might redeem it—then take one small step toward reconciliation or justice, like Judah eventually did.
Remind yourself: Your story isn't over. God uses flawed people (like Judah) in His bigger purposes—perhaps even in your family line or community.
2. Cultivate Awareness of God's Presence in Every Circumstance
Lesson reminder: "The Lord was with Joseph" repeated through success, betrayal, and prison—His presence brought blessing and favor regardless.
Apply today:
Start your day declaring (out loud or in prayer): "Lord, be with me today like You were with Joseph." Invite His presence into mundane tasks—driving to work, household chores, or interactions.
In tough moments (stress at work, loneliness, health concerns), shift your focus: Instead of "Why is this happening?" ask "Lord, how are You with me in this?" Look for small signs of favor—unexpected kindness, strength to endure, or opportunities to serve.
Practice gratitude: At day's end, note 2–3 ways you sensed God's nearness, even subtly. This builds faith for harder seasons.
3. Choose Integrity and Resist Temptation, No Matter the Cost
Lesson reminder: Joseph fled sin ("How could I sin against God?") despite pressure, while Judah compromised—integrity led to God's blessing.
Apply today:
Identify a current temptation (dishonesty at work, gossip, cutting corners, impure thoughts, or relational compromise). Decide in advance: "I will honor God here, even if it costs me."
When faced with it, literally "flee" like Joseph—walk away, change the subject, log off, or call a trusted friend for accountability.
Celebrate small wins: If you choose right today (e.g., speaking truth in a hard conversation), thank God and note how peace follows.
4. Practice Quick Repentance and Extend Grace to Others
Lesson reminder: Judah's confession ("She is more righteous than I") opened grace; Tamar sought justice amid wrong.
Apply today:
If you've wronged someone (or been hypocritical), own it soon—say "I was wrong; forgive me" without excuses. This mirrors Judah's growth.
When others fail you, respond with mercy rather than quick judgment. Ask: "How might God be at work in their story too?"
In your relationships, prioritize justice and care for the vulnerable (widows, overlooked people)—perhaps through a kind act, listening, or advocacy this week.
5. Serve Faithfully in Your Current "Place" (Even If It's a "Prison")
Lesson reminder: Joseph excelled in prison—managing well, using gifts, crediting God—preparing him for more.
Apply today:
View your current role/season (job, home life, waiting period) as God-ordained preparation. Ask: "How can I serve excellently here?"
Do the small things with excellence and give God credit (e.g., "Thanks to the Lord for helping me today").
If you're feeling "forgotten" (like by the cupbearer), keep serving anyway—God sees and times promotion perfectly. Use downtime to build skills or help others.
A Simple Daily Practice to Tie It All Together:
Morning: Read/pray over one verse (e.g., Gen 39:2–3 or 39:9). Ask God to make these truths real today.
Throughout the day: When challenges hit, whisper, "Lord, be with me like You were with Joseph."
Evening: Reflect—what did I learn about God's faithfulness? Where did I choose integrity or need repentance?
These aren't one-time fixes but habits that grow trust in God's presence and plan. Start small today—one application—and watch how He works.
most important lesson
The most important lesson from Genesis 38–40, drawn from the contrasting stories of Judah/Tamar and Joseph, is this:
God's sovereign providence and faithfulness prevail over human sin, failure, injustice, and hardship—nothing can derail His redemptive plan or separate His people from His presence and purposes.
Why This Stands Out as Central
In Genesis 38, we see profound human brokenness: Judah's hypocrisy, neglect of responsibility, immorality, and initial refusal to grant justice to Tamar. Yet through this scandalous, deceptive situation, God preserves and advances the covenant line leading to Perez → David → Jesus (Matt 1:3). Human sin doesn't stop or surprise God—He redeems even the darkest family dysfunction for His glory.
In Genesis 39–40, Joseph faces betrayal, false accusation, imprisonment, and being forgotten—yet the repeated refrain "the Lord was with Joseph" (39:2, 3, 21, 23) shows God's active presence bringing blessing, favor, and success in spite of the circumstances. Joseph's integrity shines, but the deeper point is God's unwavering commitment.
The chapters together form a powerful contrast: Judah's moral collapse vs. Joseph's faithfulness, yet both narratives prove the same truth—God remains faithful to His promises (Abrahamic covenant of descendants and blessing to the nations) and stays with His people, weaving all things (even sin and suffering) into His good plan.
This theme echoes throughout Scripture (e.g., Romans 8:28; Joseph's later words in Gen 50:20: "You meant evil... but God meant it for good"). Commentators and Bible studies often highlight it as the unifying heartbeat: hope for sinners, assurance in trials, and confidence that God's bigger story of redemption marches on regardless of our messes or misfortunes.
For Your Life Today
If you're feeling stuck in a "prison" season, betrayed, overlooked, or weighed down by personal or family failures, this lesson whispers: God is still with you, still working, and still faithful. Your current chapter—messy or unjust—cannot cancel His promises or presence. Trust that He's writing a redemptive ending you may not see yet.
Which part of this resonates most deeply with you right now?
Summary of Genesis 38–40
Judah’s sons Er and Onan die; he delays giving Tamar to Shelah. Tamar disguises as a prostitute, conceives twins (Perez & Zerah) by Judah. He admits her greater righteousness when confronted with his pledge items. Joseph prospers in Potiphar’s house because “the Lord was with him.” He flees Potiphar’s wife’s seduction, is falsely accused, and imprisoned. In prison, “the Lord was with him,” and the warden puts him in charge. Joseph interprets the cupbearer’s and baker’s dreams: cupbearer restored, baker hanged—both come true in three days. The cupbearer forgets Joseph.
Core contrast: God preserves the Messianic line through Judah’s failure (ch. 38) and blesses Joseph’s faithfulness amid injustice (chs. 39–40).
Thank you for joining me in Bible Study today. I apologize for not presenting more detailed information about Joseph. There was more I could have elaborated on, but it is one of those days where you just don’t have the mojo. I could give excuses but all I have is a headache and it’s Saturday. I think I need a Sabbath. I will continue my reading but I will not be doing the work on the computer tomorrow. I am taking a day off. I need rest. Please join me in taking a Sabbath day. I will see you again on Tuesday and will be posting the two days. Jesus says I can read my bible, as long as I do no work, right? Love you guys.

