Do NOT do #1, as you clearly have a moisture issue behind the window. If you reach in, with your finger you will likely continue to find moisture saturated wood beyond what came out already / what is visible from the surface. The expandable foam does not "breathe" and therefore traps moisture. Any moisture that penetrates / is already in there with nowhere to go will persist and continue to rot out the wood in there. You have to start by finding the source of the moisture. Start by checking any caulk seal between the window and the window frame from the exterior of your home, gaps in the caulk will allow moisture to penetrate between the window and the frame and cause this. Also check to make sure (if it's a top floor window) that you don't have any roof leaks, or leaks at the top of the window frame that are running down behind the wall and pooling in that area, causing the damage.
Once you address the issue, you can either putty or replace boards, depending on what you want the look to be. Either will look good with quality workmanship.