I'm assuming it is a power sliding rear window. My brother in law had this same exact problem with his '12 f-150. His turned out to be a simple problem that has plagued me through 3 older f-150's. His light that illuminates the bed of the truck had a leak in the seal that was creating dampness in the wiring to the window, which would cause it to not work when damp and work when dry. I replaced the seal for him and dried out the inside components as well as tested them for shorts and now it works fine again. This seems to be an issue with most f-150's (or maybe its just my family) My dad's 2004, his previous 2000, and 2002 before that all leaked (no power rear window). My 2001 and most recent 2002 both leak as well ('01 had sliding rear window but not power, and my '02 has no rear window at all). My brother in laws old f350 had the same issue as did his 2012 (his f-350 had sliding rear but no power and his 2012 has power sliding rear). Hope this helps if you havn't already gotten this resolved.