Computer-memory giant Western Digital Corp.'s chief legal officer, Michael Ray, will depart this week after nearly a quarter century at the company, one of Silicon Valley's oldest.